Jump to content

Pages cannot be restored from trash


MSP01
 Share

Recommended Posts

Hello,

I have one particular template that cannot be restored from trash. The hover menu that appears next to pages only has options Edit and Move. Trying remove the Trash status by api gives an error when you try to save the page "Call to a member function numChildren() on null".

Trying to restore the page via api does nothing at all.

Anyone else ran into something like this?

PW version is 3.0.184.

Link to comment
Share on other sites

Alas it was pretty fruitless:

Array
(
    [restorable] => 
    [notes] => Array
        (
            [0] => Page name does not contain restore information
        )

    [parent] => ProcessWire\NullPage Object
        (
            [id] => 0
            [name] => 
            [parent] => 
            [template] => 
        )

    [parent_id] => 0
    [sort] => 0
    [name] => 
    [namePrevious] => 
    [name1019] => 
    [name7200] => 
    [name7201] => 
    [name7752] => 
    [name7753] => 
    [name7754] => 
)

How ever if I just echo $trashedPage->name;

I will get out the data as usual.

Link to comment
Share on other sites

Ah, but it wasn’t fruitless at all! Now you have the error message: “Page name does not contain restore information”.

What is $trashedPage->name? It’s supposed to be the page’s ID, a period, the parent’s ID, another period, the sort position, an underscore, then the actual name, e.g. “2048.1999.4_felt-cute-might-trash-later”. ProcessWire needs this info to know how to restore the page. If it’s not there, something must have gone wrong when the page was trashed, but you can probably just add it manually. If everything else is good, the restore button should then appear in the page tree.

It would be neat if ProcessWire showed this info to superusers. It could just be where the restore button would otherwise be, or the restore button could be deactivated with the note appearing on mouseover.

  • Like 1
  • Thanks 1
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...