So I have encountered a strange behavior with subpages and can’t seem to find a fix for it. The problem only occurs on the live server so the error could come from the server and not kirby.
When an image is deleted from a subpage and you don’t save after and directly delete the page, the page folder isn’t deleted only its content, so you can’t create a new page with the same title and the deleted page dosen’t show up in the panel.
I thought it could be that rewritebase was incorrectly set as the site lives in public_html but changing rewritebase to RewriteBase /public_html only crashed the site.
On the template were the problem occurs the user can choose from a radio field if they want to submit one image or a video url. Which conditionally shows a files field or url field. So the issue happens when a user have selected image, uploaded one, and then removing it from the field and then without saving directly deletes the page.
So I’ve just enabled the error log and recreated the problem but nothing showed up in the folder i choose for the log. To be sure that I set the path to the log correctly, I checked it with phpInfo and the path shows up under local value for error_log.
I can’t really tell what might be causing this, Kirby uses pretty low level file/directory operations when removing a file and I have no idea what could prevent deleting this folder unless it was no longer accessible by the webserver.
Which version of Kirby and PHP are you using? Where are you hosting?
You can always raise an issue on GitHub, only if it is not reproducibly in other contexts, might be hard to solve unless someone has an idea.
What about custom code? Are you using any 3rd party plugins/own plugins?
Maybe just tell the user to save before deleting in the meantime, after all, this is probably nothing that will happen often?
Or if you have a chance to test this on another server, might be worth it as well.