Skip to content

Symfony 8#501

Closed
jonasdekeukelaere wants to merge 2 commits intolexik:masterfrom
jonasdekeukelaere:symfony-8
Closed

Symfony 8#501
jonasdekeukelaere wants to merge 2 commits intolexik:masterfrom
jonasdekeukelaere:symfony-8

Conversation

@jonasdekeukelaere
Copy link

@jonasdekeukelaere jonasdekeukelaere commented Feb 25, 2026

Some fixes for Symfony 8 (with the help op copilot)

  • doctrine.orm.metadata.xml.class does not exists anymore
  • Symfony\Component\Translation\Translator does not work with final version of Symfony translator

Fix for #500

/**
* {@inheritdoc}
*/
public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would use a multiline signature here

@bartmcleod
Copy link
Collaborator

@jonasdekeukelaere Can you please fix the conficts? @dsoriano I think this is the solution we need to fix the Symfony8 "final" bug

@dsoriano
Copy link
Contributor

dsoriano commented Mar 9, 2026

@bartmcleod there is 2 methods to fix the issue:

  • Decorate the Framework Bundle Translator
  • Recreate a standalone translator based on the Framework Bundle Translator model.

This one seems to be a mix between the two. It creates a standalone Translator but simulate a decorator by creating a new instance of the Symfony Translator (line 74). I don't think this is the right way.

@bartmcleod
Copy link
Collaborator

@dsoriano Well, it wraps the Symfony translator. I can see where you are coming from, but as I am not a hard core Symfony guy, I have a hard time being religious about it. If you can manage the decorator solution, that sounds elegant. We can close this one if you provide it and if it actually looks better.

@dsoriano
Copy link
Contributor

dsoriano commented Mar 9, 2026

@bartmcleod I'm on it 😉

@bartmcleod
Copy link
Collaborator

@jonasdekeukelaere Thank you for your contribution. Your solution might not follow all best practices that are expected from us, but I believe it will work. Because currently, the bundle is broken for PHP 8, I think it is best that we merge your solution until someone improves it. That will however require you to fix the conflicts, please.

@bartmcleod
Copy link
Collaborator

@jonasdekeukelaere Even without solving the conflicts, checking out your PR and trying for example bin/console gives this error:

In CheckExceptionOnInvalidReferenceBehaviorPass.php line 116:
                                                                                                              
  The service "lexik_translation.translation_storage" has a dependency on a non-existent service "doctrine". 

@dsoriano
Copy link
Contributor

@bartmcleod My PR will be ready in a few days. Actually the code is OK, the tests too. I need to improve the compatibility with the current config to avoid BC breaks, improve the tests and try it on a real project to ensure everything is ok.

Probably by the end of the week or the start of the next.

@bartmcleod bartmcleod mentioned this pull request Mar 13, 2026
@bartmcleod
Copy link
Collaborator

Superseded by #504 where I fixed the conflicts and confirmed it now works with Symfony 8

@bartmcleod bartmcleod closed this Mar 13, 2026
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

Successfully merging this pull request may close these issues.

3 participants