Prevent creating folders with trailing "/"
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Problem Statement
Creating folders with a trailing slash (e.g., test/) can cause significant issues if another folder with the same name is later created without it (e.g., test).
When this happens, both folders point to the same underlying assets and subfolders. Any modifications or deletions made through one folder will affect the other, since they share the same content.
Steps to Reproduce
- Navigate to Site Browser.
- Create a folder at the root level with test as the URI.
- Create a second folder at the root level with test/ as the URI.
- Add a subfolder named child under test.
Expected behavior: The child subfolder should only appear under test.
Actual behavior: The child subfolder also appears under test/. Deleting or modifying it from either location affects both, since the two folders share the same underlying content.
Acceptance Criteria
- The system should not allow the creation of folders with a trailing slash in the URI.
- An appropriate validation error should be displayed when a user attempts to create one.
- Validation in place on both UI and API
dotCMS Version
trunk / 26.02.27-01_3d130b5
Severity
Medium - Some functionality impacted
Links
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue through Site Browser using the listed steps, then trace folder creation in both the UI and API. Add validation that rejects folder URIs ending in a slash and verify that an appropriate error appears in both paths. Done means trailing-slash folders cannot be created through either interface.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, content, full-stack
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100