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

Field::getValue() returns defaultLocale value (if current locale value is empty empty) for non-localizable fields #1300

Merged
merged 1 commit into from
Apr 16, 2020

Conversation

I-Valchev
Copy link
Member

@I-Valchev I-Valchev commented Apr 16, 2020

🤦‍♂️

For months I worked under the assumption that non-translatable fields fallback to the default locale. But this is not how the doctrine-behaviors translate() method works. The fallback option is for en_GB to fallback to en, not to fallback to the defaultLocale.

My misunderstanding led to wrong implementation further down the line, which convoluted the problem further.

@I-Valchev I-Valchev changed the title Field::getValue() returns defaultLocale value for non-localizable fields Field::getValue() returns defaultLocale value (if current locale value is empty empty) for non-localizable fields Apr 16, 2020
Copy link
Member

@bobdenotter bobdenotter left a comment

Choose a reason for hiding this comment

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

👍

@bobdenotter bobdenotter merged commit bf2daca into master Apr 16, 2020
@bobdenotter bobdenotter deleted the bugfix/locale-fallback-value branch April 16, 2020 14:11
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