-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Description
Symfony version(s) affected
6.4.0
Description
After upgrading an application that has the translator disabled from 6.3 to 6.4, I'm getting the following error when running any command:
In CheckExceptionOnInvalidReferenceBehaviorPass.php line 88:
[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
The service "serializer.normalizer.translatable" has a dependency on a non-existent service "translator".
Exception trace:
at /app/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:88
Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processValue() at /app/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:90
Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue() at /app/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:51
Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processValue() at /app/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:99
Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue() at /app/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:51
Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processValue() at /app/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:90
Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue() at /app/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:51
Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processValue() at /app/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:48
Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->process() at /app/vendor/symfony/dependency-injection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:42
Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->process() at /app/vendor/symfony/dependency-injection/Compiler/Compiler.php:80
Symfony\Component\DependencyInjection\Compiler\Compiler->compile() at /app/vendor/symfony/dependency-injection/ContainerBuilder.php:767
Symfony\Component\DependencyInjection\ContainerBuilder->compile() at /app/vendor/symfony/http-kernel/Kernel.php:506
Symfony\Component\HttpKernel\Kernel->initializeContainer() at /app/vendor/symfony/http-kernel/Kernel.php:763
Symfony\Component\HttpKernel\Kernel->preBoot() at /app/vendor/symfony/http-kernel/Kernel.php:126
Symfony\Component\HttpKernel\Kernel->boot() at /app/vendor/symfony/framework-bundle/Console/Application.php:190
Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands() at /app/vendor/symfony/framework-bundle/Console/Application.php:72
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /app/vendor/symfony/console/Application.php:175
Symfony\Component\Console\Application->run() at /app/bin/console:49
How to reproduce
# config/packages/framework.yaml
framework:
translator:
enabled: false
Possible Solution
Add a check here:
symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
Lines 1941 to 1943 in 1a824c1
if (!class_exists(Translator::class)) { | |
$container->removeDefinition('serializer.normalizer.translatable'); | |
} |
Additional Context
Switching enabled
to true
fixes the issue.