Skip to content

fix(core): allow uppercase characters in nested collection meta path - #8007

Merged
martinjagodic merged 1 commit into
decaporg:release/3.17.2from
sap1110:7461-meta-path-case-sensitive
Oct 23, 2026
Merged

martinjagodic merged 1 commit into
decaporg:release/3.17.2from
sap1110:7461-meta-path-case-sensitive

Conversation

@sap1110

@sap1110 sap1110 commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #7461

validateMetaField checks the path meta field by running each segment through the slug processor and comparing the result with the original value. The slug processor lower-cases its input, so any path containing capital letters (e.g. Parent/Child) was rejected as an invalid path, including existing entries that live in capitalised folders.

The comparison now ignores case (using the same toLocaleLowerCase() as prepareSlug), so capitalised folder names are accepted while paths with characters the slug sanitizer would change (spaces, quotes, periods, etc.) are still rejected.

Test plan

  • Added unit tests to validateMetaField: a path with uppercase characters is valid; a path with uppercase and invalid characters is still rejected.
  • pnpm run test:unit, pnpm run lint-quiet and pnpm run type-check pass locally.

Checklist

@sap1110
sap1110 requested a review from a team as a code owner September 28, 2026 07:01
@netlify

netlify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for decap-cms ready!

Name Link
🔨 Latest commit e059c09
🔍 Latest deploy log https://app.netlify.com/projects/decap-cms/deploys/6aba10da98c19600085a255b
😎 Deploy Preview https://deploy-preview-8007--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.

@martinjagodic
martinjagodic changed the base branch from main to release/3.17.2 October 23, 2026 12:10
@martinjagodic
martinjagodic merged commit 3071551 into decaporg:release/3.17.2 Oct 23, 2026
14 checks passed
@martinjagodic

Copy link
Copy Markdown
Member

Released in v3.17.2

martinjagodic added a commit that referenced this pull request Nov 17, 2026
* fix(core): keep the case of nested entry paths in their slug

Since #8007 the meta path of a nested collection may contain uppercase
characters, but slugFromCustomPath still lowercased the whole path. The
file was committed at `pages/Guides/index.md` while persistEntry returned
the slug `guides/index`.

Because that slug differs from the entry's, the persist action reloaded
`guides/index` right after the save, which a case-sensitive git host
cannot find, leaving the editor on an entry that fails to load. Saving
an existing entry already in such a folder had the same effect, and the
collision check for a new entry probed the lowercased path instead of
the one about to be written.

Strip the collection folder without changing the case of the path.

Fixes #8068

* fix(core): derive nested slugs the way listing does

Build the slug of a saved entry with selectEntrySlug, the same helper
that names listed entries, so the two can no longer disagree. Strip
only the leading collection folder, since a nested path may repeat the
folder's name further down. Also dispatch the entry reload after
publishing a nested entry, which never ran.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Martin Jagodic <jagodicmartin1@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

Path metadata does not support case sensitive paths

2 participants