cms
cms copied to clipboard
Root Page can be added as a child in editor
Bug description
When Editing the Root Page in Control Panel, if you set the Root Page's parent you will get the error : "Root page cannot have children"
Even though the error shows, the page successfully saves. Also, the error is saying Root Page cannot have children, but the Root Page has been set as a child.

This creates a 500 error on the Front End, and forever loading on the CP pages collection.

How to reproduce
- log into Control Panel
- edit Root page
- Set Root Page's parent to other page in tree
- Save the Root Page
- Reload the CP/font end
Logs
Root page cannot have children {"userId":"user-id","exception":"[object] (Exception(code: 0): Root page cannot have children at path/vendor/statamic/cms/src/Structures/Structure.php:93)
Versions
Version: 3.2.31
*tried updating to lates (3.2.36) and it did not solve the issue
Installation
Starter Kit using via CLI
Additional details
No response
Confirmed - recorded a quick video to demonstrate:
https://www.loom.com/share/30b02f01cc06409fac224c4dfc7bfb44
I accidentally stumbled upon this bug, any workaround?
We just had a broken website with "Root page cannot have children" - are there plans to fix this?
We had a similar issue. Not sure, if adding the root page as a child was the case here. There might be another way to accidentally break the site through the control panel. I would like to suggest that the CMS than maybe outputs a warning during stache:warm
, but don't completely fail.
If the root page is not supposed to have children... ok. But maybe just remove them during the stache:warm process and display an error like "Root page can not have children. Statamic won't display them, make sure to move them to another parent element in the control panel." Failing completely in this case seems a little bit excessive here.
I can confirm that setting the root page as parent when creating a new page results in this issue. This is a major issue as normal editor behaviour breaks the entire site.
Thanks @tomhelmer ! We had broken sites because of this issue but we had no info how to reproduce. Now its clear.
Yes we have the same issue, we can add an entry and add the root page as a parent and that breakes the site.
I just repaired a broken production site with "Root page cannot have children". Any news on this?