Skip to content

fix(ui): fallback to default locale checkbox passes wrong value #12396

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jessrynkar
Copy link
Member

@jessrynkar jessrynkar commented May 13, 2025

What?

Allows document to successfully be saved when fallback to default locale checked without throwing an error.

Why?

The fallback to default locale checkbox allows users to use fallback data for required fields in additional locales, this has been broken since the release of v3.

How?

The fallback checkbox should set the field value to null allowing it to get processed through the standard locale logic and get replaced by fallback data. However, the field was passing true which would break the form and prevent it from saving.

Also adds tests to localization/e2e.

Fixes #11245

@jacobsfletch jacobsfletch changed the title fix: fallback to default locale checkbox passes wrong value fix(ui): fallback to default locale checkbox passes wrong value May 13, 2025
@jessrynkar jessrynkar requested a review from JarrodMFlesch May 13, 2025 16:22
@devj3ns
Copy link

devj3ns commented May 13, 2025

Thanks for the fix, @jessrynkar!

Quick question: When the array field is set to read-only, is the checkbox still displayed? I believe it shouldn't be shown in that case— just wanted to confirm.

@jessrynkar
Copy link
Member Author

Thanks for the fix, @jessrynkar!

Quick question: When the array field is set to read-only, is the checkbox still displayed? I believe it shouldn't be shown in that case— just wanted to confirm.

Hi @devj3ns - thanks for raising this, currently the fallback checkbox is displayed for readOnly fields but it shouldn't be. I have added a fix for this as part of this PR.

Copy link
Contributor

@DanRibbens DanRibbens left a comment

Choose a reason for hiding this comment

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

CI is failing on all the sql db adapters. I think there is more here we need to do to support this on the db side. This is going to take some thinking through since we can't set null on the DB side the same as with mongodb.

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

Successfully merging this pull request may close these issues.

ObjectParameterError thrown when checking "Fallback to default locale" on a localized array and saving the non default locale version of a document
3 participants