8000 FrameworkBundle v4.2.7 assumes "translator" service implements the contract's translator interface · Issue #31161 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

FrameworkBundle v4.2.7 assumes "translator" service implements the contract's translator interface #31161

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
pamil opened this issue Apr 18, 2019 · 1 comment

Comments

@pamil
Copy link
Contributor
pamil commented Apr 18, 2019

Symfony version(s) affected: 4.2.7

Description
SyliusThemeBundle overrides default translator service with the one that implements Symfony\Component\Translation\TranslatorInterface but not Symfony\Contracts\Translation\TranslatorInterface. This causes Symfony\Component\Validator\Util\LegacyTranslatorProxy to fail because it expects translator service to implement the contract's translator interface. It is a BC break AFAIK.

https://travis-ci.org/Sylius/Sylius/jobs/521619940#L834

How to reproduce
Override translator service not to implement Symfony\Contracts\Translation\TranslatorInterface but Symfony\Component\Translation\TranslatorInterface instead.

Possible Solution

  • make Symfony\Component\Translation\TranslatorInterface extend Symfony\Contracts\Translation\TranslatorInterface
  • allow Symfony\Component\Translation\TranslatorInterface instance to be passed to Symfony\Component\Validator\Util\LegacyTranslatorProxy
@nicolas-grekas
Copy link
Member

Please check #31164

nicolas-grekas added a commit that referenced this issue Apr 18, 2019
This PR was merged into the 4.2 branch.

Discussion
----------

[Validator] fix LegacyTranslatorProxy

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31161
| License       | MIT
| Doc PR        | -

Commits
-------

b1f3284 [Validator] fix LegacyTranslatorProxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0