Path metadata does not support case sensitive paths
- Dominant language
- JavaScript
- Stars
- 19.4k
- Forks
- 3.1k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
Hi, the path metadata handler throws an invalid path error if there are any capital letters in the path.
[validateMetaField](https://github.com/decaporg/decap-cms/blob/86d41d79b20583041570bce30b46835a36bcecf2/packages/decap-cms-core/src/actions/entries.ts#L1027) calls [getProcessSegment](https://github.com/decaporg/decap-cms/blob/main/packages/decap-cms-core/src/lib/formatters.ts#L107) which calls prepareSlug, which calls toLocaleLowercase. Because prepareSlug produces a different, lowercase string, there's a mismatch and invalid path is thrown.
I think folder names should be allowed to be capitalized. We use folder names in nested collections cosmetically, such that we need capitalization in folder names.
Let me know if any more info from the template is needed.
Contributor guide
Research direction
Start in packages/decap-cms-core/src/actions/entries.ts at validateMetaField, then trace getProcessSegment in packages/decap-cms-core/src/lib/formatters.ts and prepareSlug. Reproduce the invalid path error with capitalized folder names and inspect the relevant existing tests. Done means valid path metadata accepts the capitalization used by nested collection folders without breaking existing path validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- content
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100