getgrav / getgrav/grav-plugin-admin
404 on page creation when path name starts with »admin«
- Dominant language
- PHP
- Stars
- 377
- Forks
- 225
- Avg merge
- 11h 51m
- Merged PRs (30d)
- 4
Description
### CONTEXT
We are creating a knowledgebase for our software product. And the product has an area «Administration» so we like to create a corresponding area in our documentation.
### EXPECTED BEHAVIOR
Create a page with title **Administration** with subfolders resp. subpages.
### CURRENT BEHAVIOR
Neither a page **Administration** nor subpages cannot be created if the folder name on the root level starts with **admin**
### STEPS TO REPRODUCE
#### Easy to reproduce
I'm locally on grav.localhost but the behavior is independent of the domain and environment.
1. Add a page:
2. Press **Continue**
3. Result: redirect to http://grav.localhost/pages/administration/:add which results in an 404
#### Not as easy to reproduce because the error exists after renaming
1. Add a page **Management** on the root level; add content, subpages, modules and so on → everything works fine
2. Rename the folder on the tab **Advanced** to _administration_
3. Result: everyhing seems to work but you cannot add subpages or modules → result on creation is a redirect and a 404
It seems that it doesn't matter how the folder name is in general as long as it doesn't start with “admin”. Tried different folder names:
- **admin**istration → 404
- **admin**istrator → 404
- b**admin**ton → no issue
- home-**admin**istration → no issue
- **admin**-it-doesnt-matter-whats-coming-next → 404
This issue applies only to the top level. Having a folder **administration** on a deeper level does not have any issues.
Contributor guide
Research direction
Start by reproducing creation of a root-level page named Administration and follow the redirect to /pages/administration/:add. Compare it with a working non-admin root path and with a deeper administration path; the fix is complete when root-level names beginning with “admin” allow page, subpage, and module creation without a 404.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100