decaporg / decaporg/decap-cms

Validation error "Path '..' already exists" on meta path field with nested collections and subfolders disabled

Open
#7,534 2 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**Describe the bug**
When using a nested collection and the `subfolders: false` option (from #7387 in 3.6.2), creating or editing any content with the meta `path` field shows an error: `Path 'directory' already exists`

**To Reproduce**
1. Open the dev-test or demo site and open the Pages > Directory > Another Sub Directory collection ([direct demo link](https://demo.decapcms.org/#/collections/pages/filter/directory/another-sub-directory))
2. Click on New Page
3. Enter a page title and click Save

**Expected behavior**
The page is saved successfully at the path `directory/another-sub-directory/2025...test` using the `path` and page slug.

**Screenshots**
Image

An error on the 'Path' field: `Path 'directory/another-sub-directory' already exists`

**Applicable Versions:**
- Decap CMS version: 3.7.1
- Git provider: Test Backend (first seen on GitHub backend)
- OS: OS X
- Browser version Chrome 138

**CMS configuration**
Reproduced using the [test backend](https://github.com/decaporg/decap-cms/blob/decap-cms%403.7.1/dev-test/config.yml).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.