I’m creating a CSV import to upload a large number of images with metadata into Kirby. This process creates many pages under a collection, each containing one of the imported images. These pages are also published automatically.
However, something goes wrong during publishing. I loop through the batch of pages and publish them, and although they appear to be published correctly, when I try to delete the collection, the child pages are not deleted.
What am I doing wrong?
What I don’t quite get from your error description and cut-off screenshots is what is actually happening when you delete the parent page. Is the parent page deleted? Or does it still exists but with renumbered children? Does the Panel show an error message? What happens in the console and the network tabs in dev tools?
The parent page folder still excist but the txt file of the parent page is deleted. The panel is not giving any errors also no errors in the console or the network tab.
I could in fact reproduce this weird behavior in a fresh Starterkit. Tried to delete the photography page, and was left with this page still there, but the content file name changed to default.txt and the children all prepended with the number 1. Deleting the page again then finally deletes it.
When I open the page again in the panel, it creates the default.txt file in my kirby, which I can also delete with the subpages. This problem I mentioned only happens when the status is changed to listed, not when it’s unlisted.
Is it worth mentioning this issue somewhere else so it can be flagged as a bug and maybe fixed in a future update?
@texnixe I discovered that this issue also occurs when I create more than three public subpages under a parent page directly in the panel—not programmatically. After deleting the parent page via the panel, one of the subpages remains in the file system instead of being removed.
Initially, I thought this only happened when creating and publishing subpages in batch via code, but it turns out the issue occurs consistently, even when everything is done manually through the panel.