From 3289fe4ec22d41d19482a9d0b2e17861e6a0602b Mon Sep 17 00:00:00 2001 From: Maxime Leclercq Date: Fri, 8 Nov 2024 11:55:30 +0100 Subject: [PATCH] fix(index): with sylius > 1.12, avoid documentable always not translatable --- src/Model/Documentable/Documentable.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Model/Documentable/Documentable.php b/src/Model/Documentable/Documentable.php index cf86580..5286b2c 100644 --- a/src/Model/Documentable/Documentable.php +++ b/src/Model/Documentable/Documentable.php @@ -13,7 +13,8 @@ namespace MonsieurBiz\SyliusSearchPlugin\Model\Documentable; -use Sylius\Component\Resource\Model\TranslatableInterface; +use Sylius\Component\Resource\Model\TranslatableInterface as OldTranslatableInterface; +use Sylius\Resource\Model\TranslatableInterface; class Documentable implements PrefixedDocumentableInterface { @@ -68,7 +69,8 @@ public function isTranslatable(): bool { $interface = (array) class_implements($this->getSourceClass()); - return \in_array(TranslatableInterface::class, $interface, true); + return \in_array(TranslatableInterface::class, $interface, true) + || \in_array(OldTranslatableInterface::class, $interface, true); } public function getTemplate(string $type): ?string