Jump to content

[admin] page deletion error via API


hellomoto
 Share

Recommended Posts

I cannot manage to delete this page upon uninstallation of a Process module I have that was working previously. I thought the only difference would be that I added `namespace ProcessWire;` to the start of the module PHP, however I've tried without it and still I get 

Quote

 ProcessWire: ProcessModule: This page may not be deleted

It is an admin page. Right now I have 

    $get = 'template=admin, parent!=trash, name=importall, include=all';
    $gp = wire('pages')->get($get);
    if($gp->id) {
      wire('log')->save($log, "$gp->id".get_class($gp).__NAMESPACE__);
      $gp->delete();
      if(!wire('pages')->get($get)->id) wire('log')->save($log, "Deleted Imports page.");
    }

previously

    $gp = $this->pages->get('template=admin, parent!=trash, name=importall');
    if($gp->id) {
      $this->pages->delete($gp, true);
      $this->log->save($log, "Uninstalled ". get_class());
    }

Why will it no longer delete? I can't even do so by the GUI.

Link to comment
Share on other sites

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

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...