Repository navigation
fix: traverse localized group and tab children in locale-resolved documents - #18232
Open
guillaume-flambard wants to merge 1 commit into
Open
guillaume-flambard wants to merge 1 commit into
guillaume-flambard wants to merge 1 commit into
Conversation
guillaume-flambard
force-pushed
the
fix/traverse-fields-localized-group-resolved
branch
from
September 22, 2026 08:51
08f709a to
8b3ada8
Compare
|
Is there a blocker to get this merged? Would help us a lot |
Author
|
@FinnIckler no blocker on my side: CI is green, the branch merges clean, and there are no open review threads. It has been open since 21 Sep and has never had a maintainer review, which is the only thing it is waiting on. @JarrodMFlesch is anything missing here? |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
traverseFieldswalks a document against the field schema, and it assumes that document is in the database shape: a localized group or tab holds a map of locale codes to that locale's data.A document read back with a
locale(payload.find({ locale }),payload.findByID({ locale }),payload.findGlobal({ locale })) is in the resolved shape instead, where the localized group holds its own fields directly.The localized group and tab branch iterated every key of that value as if it were a locale. The first field name was read as a locale code, the recursion was handed the field value itself, and the object guard returned, so the whole subtree was skipped and nothing reported it.
This branch now tells the two shapes apart. When a key of the value matches one of the group's own sub field names, the value is read as resolved data and traversed directly. Otherwise the existing locale map walk runs unchanged. The same file already does this kind of shape test for localized arrays and blocks with
Array.isArray.The reproduction the issue is missing:
Before this change it logs
legalonly, thenoticefield is never visited. After it,legalandnotice.The database shape still walks exactly as before, and
packages/payload/src/utilities/traverseFields.spec.tscovers both paths.Fixes #18217