Skip to content

Commit

Permalink
fix(index): with sylius > 1.12, avoid documentable always not transla…
Browse files Browse the repository at this point in the history
…table
  • Loading branch information
delyriand committed Nov 8, 2024
1 parent 3423cda commit 3289fe4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Model/Documentable/Documentable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3289fe4

Please sign in to comment.