Skip to content

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

Closed

Conversation

inelgnu
Copy link
Contributor

@inelgnu inelgnu commented Jan 22, 2017

Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #20791
License MIT
Doc PR no

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.

@@ -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) {
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why ?

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Koc @fabpot done.

@nicolas-grekas nicolas-grekas added this to the 3.3 milestone Jan 24, 2017
@xabbuh
Copy link
Member

xabbuh commented Feb 3, 2017

Wouldn't it be better to remove the templating.helper.translator definition instead as you can use the rest of the PHP templating integration quite well without the Translation component being present?

@inelgnu
Copy link
Contributor Author

inelgnu commented Feb 15, 2017

@xabbuh I have no personal opinion on this. @fabpot @aitboudad what do you think ?

@aitboudad
Copy link
Contributor

seems better to me

@javiereguiluz
Copy link
Member

I agree with @xabbuh.

@jakzal
Copy link
Contributor

jakzal commented Mar 9, 2017

@inalgnu do you have time to finish this PR?

status: needs work

@xabbuh
Copy link
Member

xabbuh commented Mar 15, 2017

Thanks for raising the issue @inalgnu. I have opened #22006 to remove the service instead of enabling the translator part. Thus, I am closing here in favour of #22006.

@xabbuh xabbuh closed this Mar 15, 2017
fabpot added a commit that referenced this pull request Mar 17, 2017
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants