fix(core): preserve full entries returned by preSave handlers - #7989
Open
sridharkalaibala wants to merge 1 commit into
Open
fix(core): preserve full entries returned by preSave handlers#7989sridharkalaibala wants to merge 1 commit into
sridharkalaibala wants to merge 1 commit into
Conversation
✅ Deploy Preview for decap-cms ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Summary
Fixes #7966. A
preSavehandler returningentry.setIn(['i18n', locale, 'data', 'title'], value)is currently wrapped inside the entry'sdata. This causes internal entry metadata to be saved as default-locale content and leaves the translation unchanged.Preserve complete entry returns directly, while continuing to wrap field-data returns. Recognize the full entry by its Immutable Map shape and the
data,collection,slug, andpathkeys supplied bycreateEntry; checking onlydatawould misclassify a legitimate content field with that name. The event still returns the complete entry, preserving the file-collection fix from #7667.Test plan
data, and passing a translated entry through the actual multiple-folder i18n file generator. The output assertions verify intact English content and updated Portuguese content in separate files.pnpm testpasses: lint (JavaScript, CSS, formatting), TypeScript, 4 Cypress-runner tests, and 1,388 Jest tests across 112 suites with 138 snapshots. The existing 1,304 skipped tests / 2 skipped suites remain skipped.git diff --checkpasses. No live GitHub/GitLab save or browser E2E was run. No dependency or lockfile changes.Checklist