Skip to content

fix: localized array,group,blocks fields duplicate with empty values#15849

Open
jakobpevec wants to merge 2 commits intopayloadcms:mainfrom
jakobpevec:fix/15847-empty-value-of-localized-fields-when-duplicating
Open

fix: localized array,group,blocks fields duplicate with empty values#15849
jakobpevec wants to merge 2 commits intopayloadcms:mainfrom
jakobpevec:fix/15847-empty-value-of-localized-fields-when-duplicating

Conversation

@jakobpevec
Copy link

What?

Localized blocks, array, and group fields are empty when
duplicating a selected locale.

Why?

filterDataToSelectedLocales assumed field types (blocks,
array, group) always stored data directly as arrays. When
these fields are localized, data is wrapped in a locale map ({ en:
[...], de: [...] }), which was not being unwrapped before
processing.

How?

  • Added locale-aware branching for blocks, array, and group field
    types — when the field is localized, the locale map is filtered
    first, then each locale's value is recursed into
  • Extracted a filterLocaleMap helper to consistently filter and
    transform locale maps across all field types
  • Added unit tests

Fixes #15847

@jakobpevec jakobpevec changed the title Fix: Localized array,group,blocks fields duplicate with empty values fix: Localized array,group,blocks fields duplicate with empty values Mar 5, 2026
@jakobpevec jakobpevec changed the title fix: Localized array,group,blocks fields duplicate with empty values fix: localized array,group,blocks fields duplicate with empty values Mar 5, 2026
…y duplicated during selected locale duplication
@PatrikKozak PatrikKozak requested a review from JessRynkar March 10, 2026 17:35
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.

Bug: Duplicating a selected locale copies empty values for localized block fields

1 participant