Jump to content

Pages not shown in trash, restore instead of delete


hus
 Share

Recommended Posts

Hi

I have encountered a strange behavior with deleting pages.

ProcessWire version 3.0.123
Login as superuser

I have deleted 6 pages with following result:

On the page «Empty Trash» deleted pages are not listed underneath «Pages in the trash». (Menue unfolded) It says correctly that there are 6 pages in the trash.
Also in the tree-view the 6 pages are no items shown in the trash (Papierkorb) and there is no count-number.
Empty the trash permanently does not delete the pages, they get restored!

Moving a page from the tree to the trash is also not possible with the error message «undefined» from the browser. There is no entry in the error-log.

Thanks for your help!

 

image.png.73cd0aca9fb0baed1f339c8edca40160.png

image.png.f675fca07bf52850ecf7f63ae84c77e9.png

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for this hint! It was the following code in ready.php:


$ this-> addHookAfter ('Pages :: trash', null, function ($ event) {
     if ($ this-> wire ('user') -> hasRole ("editor")) $ this-> wire ('session') -> redirect ("/");
});

With this code we want to prevent users from being directed to the treelist after deleting a page. The problem was, that the role editor was also assigned to the superuser.

I am a processwire beginner and therefore I appreciate the support of this forum!

  • Like 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...