-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Force load translator since templating is enabled with php engine #21374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force load translator since templating is enabled with php engine #21374
Conversation
e61f4be
to
cb17221
Compare
@@ -110,6 +111,10 @@ public function load(array $configs, ContainerBuilder $container) | |||
throw new LogicException('Validation support cannot be enabled as the Translation component is not installed.'); | |||
} | |||
|
|||
if (!class_exists('Symfony\Component\Translation\Translator') && $isTemplatingPHPEngineEnabled) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use ::class
notation here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because that's what we are doing now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to remove the |
@xabbuh I have no personal opinion on this. @fabpot @aitboudad what do you think ? |
seems better to me |
I agree with @xabbuh. |
@inalgnu do you have time to finish this PR? status: needs work |
…s disabled (xabbuh) This PR was merged into the 3.3-dev branch. Discussion ---------- [FrameworkBundle] remove translator helper if Translator is disabled | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #20928 (comment), #21374 | License | MIT | Doc PR | Commits ------- 25ea510 remove translator helper if Translator is disabled
This pr will fix a bug introduced in #20928
The "templating.helper.translator" service has a dependency on translator and container compilation will break if templating engine is set to "php" only.