Skip to content
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

[FrameworkBundle] call method with Translator component only #31156

Merged
merged 1 commit into from Apr 18, 2019

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Apr 18, 2019

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

@notrix
Copy link

notrix commented Apr 18, 2019

👍

@nicolas-grekas
Copy link
Member

Thank you @xabbuh.

@nicolas-grekas nicolas-grekas merged commit f49881d into symfony:4.2 Apr 18, 2019
nicolas-grekas added a commit that referenced this pull request Apr 18, 2019
…ly (xabbuh)

This PR was merged into the 4.2 branch.

Discussion
----------

[FrameworkBundle] call method with Translator component only

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

Commits
-------

f49881d call method with Translator component only
@xabbuh xabbuh deleted the issue-31152 branch April 18, 2019 06:44
demotivationme pushed a commit to garlicservices/graphql-bundle that referenced this pull request Apr 18, 2019
@jsamouh
Copy link
Contributor

jsamouh commented Apr 18, 2019

Class string instead of ::class won’t be better ?

@stof
Copy link
Member

stof commented Apr 18, 2019

@jsamouh no. The ::class allows us to rely on use statements (and also helps IDEs find it as a usage of the class), and it is still fine even when the class does not exists, as this ::class constant is a special one in PHP. It is entirely resolved by the compiler and does not require the class to exist.
For any code written in symfony 3.4+, we can use it (as that was introduced in PHP 5.5).

@jsamouh
Copy link
Contributor

jsamouh commented Apr 18, 2019

thanks for the explanation

GSadee added a commit to Sylius/Sylius that referenced this pull request Apr 19, 2019
…sts passing (pamil)

This PR was merged into the 1.3 branch.

Discussion
----------

See symfony/symfony#31152 and symfony/symfony#31156.

Commits
-------

dcb0bf0 Add a workaround for GridBundle & Symfony 4.2.7 to make tests passing
@d42ohpaz
Copy link

Another solution that would not require installing anything temporarily is to tell composer to avoid using 4.2.6 of the symfony/framework bundle:

"symfony/framework-bundle": "^4.2,!=4.2.7",

This will force composer to downgrade/skip 4.2.7 and not produce any missing interface errors.

azzra added a commit to botilka/botilka that referenced this pull request Apr 23, 2019
azzra added a commit to botilka/botilka that referenced this pull request Apr 23, 2019
* add parametrable prefix for resources descriptions endpoints

* fix due to symfony/symfony#31156
goetas added a commit to goetas/NelmioApiDocBundle that referenced this pull request Apr 24, 2019
@nCrazed
Copy link

nCrazed commented Apr 24, 2019

Is there an ETA for this to be released?

Considering that some of the recently discovered security problems (e.g. CVE-2019-10909) apply to all 4.2.* version prior to 4.2.7 effectively blocking the 4.1 to 4.2 upgrade.

@snebes
Copy link

snebes commented Apr 24, 2019

@nCrazed The normal release schedule is every 2 weeks, which would be May 28. Assuming they don't release early.

The work around from @Gemorroj was to:

temporary add to requirements "symfony/translation": "4.2.*", to fix this

@vincentchalamon
Copy link
Contributor

What about using the symfony/validator component out of a Symfony project (without the FrameworkBundle)? As the Symfony\Component\Validator\Util\LegacyTranslatorProxy implements an interface probably not installed (Symfony\Component\Translation\TranslatorInterface), it may not work, right? Cause the symfony/validator component doesn't require the symfony/translator

@xabbuh
Copy link
Member Author

xabbuh commented Apr 26, 2019

@vincentchalamon But in that case you do not have the need to use the LegacyTranslatorProxy class at all.

@fabpot fabpot mentioned this pull request May 1, 2019
GuilhemN pushed a commit to nelmio/NelmioApiDocBundle that referenced this pull request May 2, 2019
* allow typed embedded relation with hateoas 3.0

* symfony/framework-bundle 4.2.7 is broken

symfony/symfony#31156

* internal public methods
Tobion added a commit that referenced this pull request Jul 22, 2019
… (alcaeus)

This PR was merged into the 3.4 branch.

Discussion
----------

Ignore missing translation dependency in FrameworkBundle

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

This applies the fix from #31156 to the validator.xml file. The error came up a couple of times in the test suite for DoctrineBundle. When using `symfony/framework-bundle` with `symfony/validator` installed but without `symfony/translation`, the call to `setTranslator` will error out because of the missing `translator` service. Thus, the call to `setTranslator` needs to ignore a missing translator dependency to support this scenario.

I don't know how to best test this since the translation component is present in the `require-dev` directive of FrameworkBundle's `composer.json`. If you have any suggestions how to achieve this, please let me know.

Commits
-------

19eb90d Ignore missing translation dependency in FrameworkBundle
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.

None yet