Skip to content

fix(core): allow a blank meta path when it is not required - #8058

Merged
martinjagodic merged 3 commits into
decaporg:mainfrom
sap1110:7094-optional-meta-path
Nov 17, 2026
Merged

martinjagodic merged 3 commits into
decaporg:mainfrom
sap1110:7094-optional-meta-path

Conversation

@sap1110

@sap1110 sap1110 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #7094

A nested collection's meta.path field can be marked required: false, but validateMetaField still returned "is not a valid path" for an empty value, so the entry could not be saved. Empty values are now accepted when the field is optional. Saving already handles a blank path: selectCustomPath returns nothing, so new entries use the collection path/slug and existing entries keep their current path. Non-empty values are still validated as before, and required meta paths behave the same. Also adds required to the EntryField type.

Test plan

  • Added a unit test for an optional meta path with null, undefined and empty values (fails without the change).
  • pnpm run test:unit, pnpm run lint-quiet and pnpm run type-check pass.

Checklist

A nested collection's meta path field can be set to `required: false`, but
validation still rejected an empty value as an invalid path. An empty path is
now accepted for optional fields, and the entry falls back to the collection
path and slug as it does without a meta path.

Fixes decaporg#7094
@sap1110
sap1110 requested a review from a team as a code owner November 4, 2026 08:32
@netlify

netlify Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for decap-cms ready!

Name Link
🔨 Latest commit 28e2dcf
🔍 Latest deploy log https://app.netlify.com/projects/decap-cms/deploys/6afc1e3fd9adb2dbfa2736ce
😎 Deploy Preview https://deploy-preview-8058--decap-cms.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Documents the option and rejects non-boolean values such as "false".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@martinjagodic
martinjagodic enabled auto-merge (squash) November 17, 2026 09:27
@martinjagodic
martinjagodic merged commit dd5e670 into decaporg:main Nov 17, 2026
14 checks passed
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.

meta: path should allow for blank paths upon publishing...fallback to path:

2 participants