Skip to content

Update to 4.2.7 - Fatal error: Interface 'TranslatorInterface' not found #31152

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
camya opened this issue Apr 17, 2019 · 23 comments
Closed

Update to 4.2.7 - Fatal error: Interface 'TranslatorInterface' not found #31152

camya opened this issue Apr 17, 2019 · 23 comments

Comments

@camya
Copy link

camya commented Apr 17, 2019

Symfony version(s) affected: 4.2.7

Description
After my composer update from 4.2.6 to 4.2.7 I get the following fatal error.

Fatal error: Interface 'Symfony\Component\Translation\TranslatorInterface' not found 
in testarea_symfony_api\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"?

How to reproduce

Upgrade from 4.2.6 to 4.2.7 via composer update.

@jsamouh
Copy link
Contributor

jsamouh commented Apr 17, 2019

same error

1 similar comment
@jmunozco
Copy link

same error

@fdbatista
Copy link

fdbatista commented Apr 17, 2019

does anyone have a solution for this? comopser update seems fine, but i'm getting this error when trying to issue doctrine:cache:clear

@TomaszGasior
Copy link

does anyone have a solution for this? update seems fine, but i´m getting this problem when trying to issue php bin/console doctrine:cache:clear

#31108 (comment)

@fdbatista
Copy link

does anyone have a solution for this? update seems fine, but i´m getting this problem when trying to issue php bin/console doctrine:cache:clear

#31108 (comment)

thanks!

@dqblanco
Copy link

Same error. For the moment we go back to version 4.2.6.

@TomaszGasior
Copy link

Mailbox spammed by thousands of "same error" mails won't help them to fix it up. ;)

@nicolas-grekas
Copy link
Member

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

Thanks @Gemorroj for providing this workaround.
I'll have a look tomorrow, unless someone submits a PR meanwhile.

@goetas
Copy link
Contributor

goetas commented Apr 17, 2019

I have the same issue.

The problem here is that LegacyTranslatorProxy exits, but it implements Symfony\Component\Translation\TranslatorInterface and Symfony\Contracts\Translation\TranslatorInterface that can be not available, thus a fatal error is triggered in that case since is not possible to load the interfaces to complete LegacyTranslatorProxy definitions.

@notrix
Copy link

notrix commented Apr 18, 2019

Same error here

@xabbuh
Copy link
Member

xabbuh commented Apr 18, 2019

see #31156

nicolas-grekas added a commit that referenced this issue 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
TomaszGasior added a commit to TomaszGasior/RadioLista-v3 that referenced this issue Apr 19, 2019
GSadee added a commit to Sylius/Sylius that referenced this issue 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
@camya
Copy link
Author

camya commented Apr 21, 2019

Hi. This bug report is closed but I still get this exception after updating to 4.2.7.

Is this already fixed, or how can I apply a workaround to update to the latest version?

Fatal error: Interface 'Symfony\Component\Translation\TranslatorInterface' not found in "\testarea_symfony_api\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"?

@TomaszGasior
Copy link

TomaszGasior commented Apr 21, 2019

Something like this can help: TomaszGasior/RadioLista-v3@1c8170d

Until new release of framework-bundle you need to fork framework-bundle repository and create your own branch for commit with bugfix.

Or you can just install translator component. ;)

@RikudouSage
Copy link

RikudouSage commented Apr 23, 2019

@chokrijobs
Copy link

composer req symfony/translation

@Spomky
Copy link
Contributor

Spomky commented Apr 23, 2019

So the idea to solve that issue is to require something we don't need...
Prefer not to do that and wait for a better solution.

@stof
Copy link
Member

stof commented Apr 23, 2019

the other solution is to install the dev version of FrameworkBundle, which already contains the patch, which will be part of the 4.2.8 release.

@RikudouSage
Copy link

@Spomky @stof Or use the cweagans/composer-patches package to patch it for you before they release it.

Then in composer.json:

{
  "extra": {
    "patches": {
      "symfony/framework-bundle": {
        "Fix translator": "https://github.com/symfony/framework-bundle/commit/9c3f47e28e0ea66b762b99a8573d6d7acaa43244.patch"
      }
    }
  }
}

@featuriz
Copy link

featuriz commented May 1, 2019

I'm not using "symfony/translation" in my project, But I'm using symfony validator. Up to now it worked fine. Do I have to install "translation" eventhough I'm not using it? Is it so?

@xabbuh
Copy link
Member

xabbuh commented May 1, 2019

@featuriz You can do that for the moment as a workaround until the fix from #31156 is released with Symfony 4.2.8.

@featuriz
Copy link

featuriz commented May 1, 2019

@xabbuh "symfony/framework-bundle": "^4.2,!=4.2.7",
Do I have to do this?
Skip 4.2.7

@TomaszGasior
Copy link

@featuriz Just install translator and update framework bundle.

@RikudouSage
Copy link

RikudouSage commented May 1, 2019

@featuriz or use the patch approach:

#31152 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests