Rob Posted August 30, 2013 Posted August 30, 2013 Hi all. I've run into a strange issue and am getting the following error when I try to empty the trash: Error: Call to a member function hasRole() on a non-object (line 1203 of /var/www/vhosts/web_v4/admin/wire/core/Page.php) I am also getting this error when I try to edit or delete some of the individual pages in the trash. I cannot delete any of them, and if I try I sometimes get that error and sometime it bounces back to the page listing but all the pages still remain. I had a hunt in the forum and I found some references to the above error but in a different context. The only other detail worth mentioning is that I am on v2.2.12. My instinct is that there is perhaps pages in the trash for which the relevant template/fields no longer exist and this is causing some sort of confusion. Any suggestions welcomed. I am trying to delete old unused templates but I can't because (I think) pages in the trash are still using them! Thanks.
Soma Posted August 30, 2013 Posted August 30, 2013 Not sure but try updating PW. Also you possibly use repeaters?
ryan Posted September 3, 2013 Posted September 3, 2013 Edit the line that it's talking about in Page.php and change it from this: if(!$template->hasRole('guest')) return false; to this: if(!$template || !$template->hasRole('guest')) return false; This change is also already present on the dev branch (I ran into the same error a few weeks ago). 2
Rob Posted September 4, 2013 Author Posted September 4, 2013 Great, that nailed the problem - thanks Ryan!
adrian Posted September 20, 2013 Posted September 20, 2013 Thanks for the fix Ryan - that error was popping up while developing a module!
Valery Posted January 16, 2014 Posted January 16, 2014 Had the exact same issue with a stubborn Trash. Patched my 2.3.1 installation manually -- thanks Ryan! 1
Slav Posted June 20, 2017 Posted June 20, 2017 (edited) Hi, I have another error when trying to empty trash: Error: Call to a member function path() on a non-object (line 948 of my/website/directories/here/site/modules/ProDrafts/ProDrafts.module) Thats it ... can anyone help? EDIT: So I found the solution! For some reason it is impossible to empty trash if there are pages that are Draft's (have a paperclip next to the page name). Just Publish the pages so that the paperclip is no more and then You can empty trash without a problem! Cheers! Edited June 22, 2017 by Slav Found answer!
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