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] decorate the ValidatorBuilder's translator with LegacyTranslatorProxy #31108

Merged
merged 1 commit into from Apr 17, 2019

Conversation

Projects
None yet
10 participants
@nicolas-grekas
Copy link
Member

nicolas-grekas commented Apr 14, 2019

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

This allows defining a translator that implements only the new interface and use it with ValidatorBuilder.

ping @dvdknaap, @snebes since you were affected.

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:fwb-validator-translator branch from 01b2963 to a12656e Apr 14, 2019

@snebes

snebes approved these changes Apr 15, 2019

Copy link

snebes left a comment

This change corrects the error I was getting. Thank you!

@fabpot fabpot merged commit a12656e into symfony:4.2 Apr 17, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details

fabpot pushed a commit that referenced this pull request Apr 17, 2019

bug #31108 [FrameworkBundle] decorate the ValidatorBuilder's translat…
…or with LegacyTranslatorProxy (nicolas-grekas)

This PR was merged into the 4.2 branch.

Discussion
----------

[FrameworkBundle] decorate the ValidatorBuilder's translator with LegacyTranslatorProxy

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

This allows defining a translator that implements only the new interface and use it with ValidatorBuilder.

ping @dvdknaap, @snebes since you were affected.

Commits
-------

a12656e [FrameworkBundle] decorate the ValidatorBuilder's translator with LegacyTranslatorProxy

@fabpot fabpot referenced this pull request Apr 17, 2019

Merged

Release v4.2.7 #31148

@Gemorroj

This comment has been minimized.

Copy link

Gemorroj commented Apr 17, 2019

    "require": {
        "php": "^7.2",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "ext-apcu": "*",
        "ext-pdo_pgsql": "*",
        "ext-curl": "*",
        "ext-json": "*",
        "ext-soap": "*",
        "ext-intl": "*",
        "symfony/console": "4.2.*",
        "symfony/dotenv": "4.2.*",
        "symfony/flex": "^1.1",
        "symfony/framework-bundle": "4.2.*",
        "symfony/yaml": "4.2.*",
        "symfony/orm-pack": "*",
        "symfony/validator": "4.2.*",
        "symfony/security-bundle": "4.2.*",
        "symfony/intl": "4.2.*",
        "symfony/form": "4.2.*",
        "symfony/serializer": "4.2.*",
        "symfony/monolog-bundle": "^3.3",
        "misd/phone-number-bundle": "^2.0@dev",
        "nelmio/api-doc-bundle": "^3.4",
        "nelmio/cors-bundle": "^1.5",
        "lexik/jwt-authentication-bundle": "^2.6",
        "martin-georgiev/postgresql-for-doctrine": "^1.1",
        "fresh/doctrine-enum-bundle": "^6.2",
        "barbieswimcrew/zip-code-validator": "^1.3",

        "symfony/swiftmailer-bundle": "^3.2",
        "symfony/twig-bundle": "4.2.*",

        "shapecode/cron-bundle": "^3.2.3",
        "pagerfanta/pagerfanta": "^2.0",
        "wsdltophp/packagegenerator": "^3.2",
        "wsdltophp/wssecurity": "^1.2"
    },
    "require-dev": {
        "symfony/maker-bundle": "^1.7",
        "symfony/debug-bundle": "4.2.*",
        "easycorp/easy-log-handler": "^1.0.5",
        "phpstan/phpstan-symfony": "^0.10",
        "phpstan/phpstan-phpunit": "^0.10",
        "friendsofphp/php-cs-fixer": "^2.13"
    },

after update

 [KO]
Script cache:clear returned with error code 255
!!  
!!  Fatal error: Interface 'Symfony\Component\Translation\TranslatorInterface' not found in S:\OSPanel\domains\saas-shipping-backend.loc\vendor\symfony\validator\Util\LegacyTranslatorProxy.php on line 21
!!  
!!  In LegacyTranslatorProxy.php line 21:
!!                                                                                                       
!!    Attempted to load interface "TranslatorInterface" from namespace "Symfony\Component\Translation".  
!!    Did you forget a "use" statement for "Symfony\Contracts\Translation\TranslatorInterface"?          
!!                                                                                                       
!!  
!!  
Script @auto-scripts was called via post-update-cmd
@Gemorroj

This comment has been minimized.

Copy link

Gemorroj commented Apr 17, 2019

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

@leonexcc

This comment has been minimized.

Copy link

leonexcc commented Apr 17, 2019

This breaks Contao (https://github.com/contao/contao) 4.7.4 in combination with symfony/validator (v4.2.7):

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Symfony\Component\Validator\Util\LegacyTranslatorProxy::__construct() must implement interface Symfony\Contracts\Translation\TranslatorInterface, instance of Contao\CoreBundle\Translation\Translator given,....

The Contao translator still implements the legacy interface and is blindly wrapped into the proxy. With symfony/framework-bundle v4.2.6 everything workes fine.

@nicolas-grekas nicolas-grekas deleted the nicolas-grekas:fwb-validator-translator branch Apr 17, 2019

@nicolas-grekas

This comment has been minimized.

Copy link
Member Author

nicolas-grekas commented Apr 17, 2019

See #31152

@sdaoudi

This comment has been minimized.

Copy link

sdaoudi commented Apr 17, 2019

sheeep added a commit to sheeep/conflicts that referenced this pull request Apr 18, 2019

leofeyer added a commit to contao/conflicts that referenced this pull request Apr 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.