8000 [symfony/translation] Error in readLocalTranslations() · Issue #44185 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[symfony/translation] Error in readLocalTranslations() #44185

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
tomasz-kusy opened this issue Nov 21, 2021 · 5 comments
Closed

[symfony/translation] Error in readLocalTranslations() #44185

tomasz-kusy opened this issue Nov 21, 2021 · 5 comments

Comments

@tomasz-kusy
Copy link
Contributor

Symfony version(s) affected

5.3

Description

Method readLocalTranslations has wrongly implemented filterCatalogue method;
In TranslationTrait
near line 35
we have:

                foreach ($domains as $domain) {
                    $catalogue = $this->filterCatalogue($catalogue, $domain);
                    $bag->addCatalogue($catalogue);
                }

The problem is:

                    $catalogue = $this->filterCatalogue($catalogue, $domain);

If there are more than one domain, after the first run of the loop we got filtered $catalogue. So we can't find second domain.

How to reproduce

try to to use readLocalTranslations() with more than one $domain

Possible Solution

                foreach ($domains as $domain) {
                    $catalogue = $this->filterCatalogue($catalogue, $domain);
                    $bag->addCatalogue($catalogue);
                }

change to:

                foreach ($domains as $domain) {
                    $newCatalogue = $this->filterCatalogue($catalogue, $domain);
                    $bag->addCatalogue($newCatalogue);
                }

Additional Context

No response

@tomasz-kusy
Copy link
Contributor Author

Any news? I think that this error is very obvious :)

@fabpot
Copy link
Member
fabpot commented Nov 29, 2021

Would you like to submit a PR?

@tomasz-kusy
Copy link
Contributor Author

Sure

@tomasz-kusy
Copy link
Contributor Author

@fabpot As I see now it's fixed in 5.4. I'm not sure about versions maintenance policy... Submit PR for 5.3?

@nicolas-grekas
Copy link
Member

Yes please, 5.3 is still maintained.

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

5 participants
0