Skip to content

Commit 6c9d334

Browse files
authored
Merge pull request #225 from delyriand/fix/compatibility-1.12
Fix indexation: with sylius > 1.12, avoid documentable always not translable
2 parents 3423cda + 3289fe4 commit 6c9d334

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Model/Documentable/Documentable.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
namespace MonsieurBiz\SyliusSearchPlugin\Model\Documentable;
1515

16-
use Sylius\Component\Resource\Model\TranslatableInterface;
16+
use Sylius\Component\Resource\Model\TranslatableInterface as OldTranslatableInterface;
17+
use Sylius\Resource\Model\TranslatableInterface;
1718

1819
class Documentable implements PrefixedDocumentableInterface
1920
{
@@ -68,7 +69,8 @@ public function isTranslatable(): bool
6869
{
6970
$interface = (array) class_implements($this->getSourceClass());
7071

71-
return \in_array(TranslatableInterface::class, $interface, true);
72+
return \in_array(TranslatableInterface::class, $interface, true)
73+
|| \in_array(OldTranslatableInterface::class, $interface, true);
7274
}
7375

7476
public function getTemplate(string $type): ?string

0 commit comments

Comments
 (0)