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

Get correct field value depending on localization settings #1299

Merged
merged 3 commits into from
Apr 15, 2020

Conversation

I-Valchev
Copy link
Member

Okay so an explanation about this...

We only want to get the the translated field if the field is translatable.
If it is not, we want the default value. By getting it explicitly, we make sure that even if setLocale was called somewhere earlier, we will override it.

Main cause for this is that the DoctrineBehaviors translate method does too much things at once. Sometimes you want to get the translated value without changing the object. At other times, you want to prepare the object for future use by changing its current locale.

@bobdenotter bobdenotter merged commit 353f30e into master Apr 15, 2020
@bobdenotter bobdenotter deleted the bugfix/backend-display-language branch April 15, 2020 13:23
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.

2 participants