theo Posted February 18, 2019 Share Posted February 18, 2019 Hello I am trying to enable "Trash for all", but it doesn't seem to work: https://processwire.com/blog/posts/processwire-3.0.107-core-updates/#trash-for-all I enabled it in "Modules > Configure > ProcessPageList" and the "editor" user has "page-delete" permission. But I can't see anything like "Trash" in the page lister? What am I missing? Thank you. Link to comment Share on other sites More sharing options...
Robin S Posted February 18, 2019 Share Posted February 18, 2019 Not sure sorry, but it's working for me: 1 Link to comment Share on other sites More sharing options...
theo Posted February 19, 2019 Author Share Posted February 19, 2019 @Robin S Thank you. Did you do anything "special" to make it work? I really don't know what else I can do. Here it looks like: Link to comment Share on other sites More sharing options...
theo Posted February 19, 2019 Author Share Posted February 19, 2019 Now I see. It does not show, because I have moved the 404 page under "admin", as suggested by kongondo. If I reparent the 404 Page under "home" again the trashcan is showing for my "editor". Strange. Would you say it's a bug? Shall I report it? Thank you. 2 Link to comment Share on other sites More sharing options...
szabesz Posted February 19, 2019 Share Posted February 19, 2019 2 hours ago, theo said: Would you say it's a bug? I would because Ryan did not wrote in his blog post that it is a requirement not to move the 404 page. 2 hours ago, theo said: Shall I report it? Yes please ? 3 Link to comment Share on other sites More sharing options...
Robin S Posted February 19, 2019 Share Posted February 19, 2019 It's strange that the location of the 404 page would affect the trash. An alternative way to hide the 404 page instead of moving it is to hook Page::listable() $wire->addHookAfter('Page::listable', function(HookEvent $event) { if($this->wire('user')->isSuperuser()) return; $page = $event->object; if($page->id === 27) $event->return = false; }); I actually like to go a bit further than this, and say that if a page is in the top level and is hidden and the user doesn't have edit access for the page then it is of no concern to them and they don't need to see it in Page List: $wire->addHookAfter('Page::listable', function(HookEvent $event) { if($this->wire('user')->isSuperuser()) return; $page = $event->object; if($page->parent->id === 1 && $page->isHidden && !$page->editable) $event->return = false; }); In my case I give the 404 page a dedicated template that non-superusers do not have edit access for, and so it is hidden in Page List. 2 Link to comment Share on other sites More sharing options...
theo Posted February 19, 2019 Author Share Posted February 19, 2019 Thank you all. Bug report is here: https://github.com/processwire/processwire-issues/issues/817 1 Link to comment Share on other sites More sharing options...
theo Posted March 1, 2019 Author Share Posted March 1, 2019 For the record: According to Ryan, it is not good to move the 404 Page under "admin". https://github.com/processwire/processwire-issues/issues/817 1 Link to comment Share on other sites More sharing options...
theo Posted March 1, 2019 Author Share Posted March 1, 2019 But still, I'm not happy. I've closed the bug report, but afterwards I have found out, that it is not only a problem if I move 404 under admin, but also, if I hide it like this. $wire->addHookAfter('Page::listable', function(HookEvent $event) { if($this->wire('user')->isSuperuser()) return; $page = $event->object; if($page->id === 27) $event->return = false; }); So there seems to be no way the let the "editor" see the trashcan AND not see the 404 page in the backend. What do you think? Shall I reopen the bug report? Thank you! 1 Link to comment Share on other sites More sharing options...
szabesz Posted March 1, 2019 Share Posted March 1, 2019 (edited) 5 hours ago, theo said: not see the 404 page in the backend. One easy option to hide it is to install @tpr's AdminOnSteroids module, which – among others – adds the CSS class role-superuser to <body> so you can also use its Admin CSS feature: body:not(.role-superuser) .PageListID27 { display: none; } Edited March 1, 2019 by szabesz typo 2 Link to comment Share on other sites More sharing options...
adrian Posted March 1, 2019 Share Posted March 1, 2019 5 hours ago, theo said: What do you think? Shall I reopen the bug report? I think so - even if the CSS approach works, it' really strange to me that the 404 page affects trash for all - sounds like there is still a bug there somewhere. 2 Link to comment Share on other sites More sharing options...
theo Posted March 1, 2019 Author Share Posted March 1, 2019 @adrian Thanks, reopened: https://github.com/processwire/processwire-issues/issues/817 Thank you also @szabesz It is good to have a workaround, but I think it should be fixed (if possible) in the "trash for all" code. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now