-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Localized fields in relationship drawer are populated in the default locale, not in the current locale #9979
Comments
@felixmokross Have you tried updating your versions of Payload, Next, and Node? When I tried to reproduce the issue in Payload 3.9.0, it worked as expected. |
@felixmokross I was able to successfully reproduce this bug. Thanks for your clarification. I missed the step of clicking on the pencil icon in the relation drawer in my initial attempt. |
This issue has been automatically locked. |
🚀 This is included in version v3.13.0 |
Describe the Bug
When opening the Relationship drawer, localized fields of the related collection item are populated in the default locale instead of the current locale. Even though the field label correctly shows the current locale code, the value comes from the default locale.
In our application, we heavily rely on relationships with localized content in collections with many items. Therefore, this bug gives us a bit of a headache. We could give the users a workaround if the Relationship field or drawer had a link to the full page of the relationship item (this would generally be a handy feature). But currently, users have to open the drawer, copy the item ID, then go to the related collection and look up the item by ID.
I observed this issue already on 3.0, but was only now able to create a minimal reproduction.
Link to the code that reproduces this issue
https://github.com/felixmokross/payload/tree/locale-bug-repro/test/_community
Reproduction Steps
en: 'hello'
es: 'hola'
es
, while the default locale isen
.Observed behavior: The Relationship drawer opens. In the localized field the value is populated in the default locale ('hello'). However, the field's label indicates correctly the current locale.
Expected behavior: In the localized field the value is populated in the current locale ('hola').
Relationship drawer for the collection (A) item:
Edit view of the collection (A) item:
Which area(s) are affected? (Select all that apply)
area: ui
Environment Info
The text was updated successfully, but these errors were encountered: