Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Oct 14, 2023
1 parent 4ef01ea commit ad01b39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/Block/LocaleSwitcherBlockService.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ public function execute(BlockContextInterface $blockContext, ?Response $response
{
$template = $blockContext->getTemplate();

\assert(\is_string($template));

return $this->renderResponse($template, [
'block_context' => $blockContext,
'block' => $blockContext->getBlock(),
Expand Down
3 changes: 2 additions & 1 deletion src/DependencyInjection/SonataTranslationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
Expand Down Expand Up @@ -155,7 +156,7 @@ private function registerTranslatableListener(ContainerBuilder $container, array
// Registration based on the documentation
// see https://github.com/doctrine-extensions/DoctrineExtensions/blob/7c0d5aeab0f840d2a18a18c3dc10b0117c597a42/doc/symfony4.md#doctrine-extension-listener-services
$container->register('sonata_translation.listener.translatable', TranslatableListener::class)
->addMethodCall('setAnnotationReader', [new Reference('annotation_reader')])
->addMethodCall('setAnnotationReader', [new Reference('annotation_reader', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)])
->addMethodCall('setDefaultLocale', ['%locale%'])
->addMethodCall('setTranslatableLocale', ['%locale%'])
->addMethodCall('setTranslationFallback', [false])
Expand Down

0 comments on commit ad01b39

Please sign in to comment.