diff --git a/lib/Container/Compiler/FieldType/RichTextIndexablePass.php b/lib/Container/Compiler/FieldType/RichTextIndexablePass.php index 26ff3054..b017af16 100644 --- a/lib/Container/Compiler/FieldType/RichTextIndexablePass.php +++ b/lib/Container/Compiler/FieldType/RichTextIndexablePass.php @@ -8,6 +8,7 @@ use Netgen\IbexaSearchExtra\Core\FieldType\RichText\Indexable as IndexableRichText; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Definition; class RichTextIndexablePass implements CompilerPassInterface { @@ -23,10 +24,8 @@ public function process(ContainerBuilder $container): void private function redefineIndexableImplementation(ContainerBuilder $container, $shortTextLimit): void { - $definition = $container->findDefinition(SearchField::class); - - $definition->setClass(IndexableRichText::class); - $definition->setArgument(0, $shortTextLimit); + $definition = new Definition(IndexableRichText::class); + $definition->addArgument($shortTextLimit); $definition->addTag('ibexa.field_type.indexable', ['alias' => 'ezrichtext']); $container->setDefinition(SearchField::class, $definition);