Skip to content

[6.x] Fix sync/desync on localizable nested fields#14335

Merged
jasonvarga merged 1 commit into6.xfrom
localized-nested-fields
Apr 7, 2026
Merged

[6.x] Fix sync/desync on localizable nested fields#14335
jasonvarga merged 1 commit into6.xfrom
localized-nested-fields

Conversation

@duncanmcclean
Copy link
Copy Markdown
Member

This pull request fixes syncing/desyncing nested fields (like grid, group, replicator, etc) when localizable: true.

In v5, when a nested field's value was updated, it would emit events which would eventually make their way back up to the respective fieldtype component (eg. Grid.vue), which would emit an event of its own, and eventually update the container, causing the localizedFields state to be updated.

Publish Containers were completely rewritten in v6 — methods/state can be accessed by child components via injection, doing away with the need for emitting events all the way up the chain.

When a nested field's value is updated, its value is updated directly in the container's state without needing to go up the chain to the nested fieldtype component. However, this meant that the nested key was being added to the localizedFields array, rather than the key of the "root" field.

This PR ensures we pass the path of the "root" field to syncField() and desyncField() instead of the nested field's full path. Not 100% sure if it's the right solution, so if you can think of an alternative, let me know!

Fixes #13822

@DonnyOexman
Copy link
Copy Markdown

DonnyOexman commented Apr 7, 2026

@jasonvarga (cc @duncanmcclean) Is it possible, please, to merge this in the core of Statamic? We're having issues with the SEO pro addon and our client is unable to translate the value of the fields.

@marcorieser
Copy link
Copy Markdown
Contributor

@DonnyOexman You can composer patch this PR in to your project until it's merged

@jasonvarga jasonvarga merged commit 07d8012 into 6.x Apr 7, 2026
18 checks passed
@jasonvarga jasonvarga deleted the localized-nested-fields branch April 7, 2026 19:38
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.

Fields do not sync/unsync when localizable option is on

4 participants