Inxentas Posted March 27 Share Posted March 27 I'm developing a module that installs a couple of nested pages beneat the Admin page (and assigns the module as a Process to them). In the install method, I create these pages from top to bottom. In the uninstall method, I do the reverse and delete all children before deleting their parent page. However, I get the following error message: ProcessWire: ProcessModule: Can't delete Page 1563 because it has one or more children. This is strange as the script makes sure that isn't the case, as these are all deleted. Afterwards, their children are indeed nicely deleted. I've done a couple of checks. When I first delete all children, and use $message to print out $p->children()->count that returns zero, as expected. Yet $p cannot be deleted after confirming it's zero, because "it has children". Does anyone have any idea why? Extra information: Beneath the Admin page I create a new page called "Webshop" and assign my module as a Process to this page. This creates a button in the menu that leads to the primary admin interface of the webshop, for which I use a view. This all works nicely. The module installs a template named "orders" beneath this page, as I was planning to collect webshop orders beneath that one. In the uninstall method, I make sure to first delete all pages of the template "order" and "orders" before I attempt to delete the Webshop Process page. On an unintall attempt, I get above error message, but when I check whether the page it references (1563) indeed has children, these are indeed deleted in accordance with my code. Only the Webshop page remains, and it's Process is (logically) empty. Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now