cehlo Posted November 3, 2019 Share Posted November 3, 2019 Hi folks, I am reaching you one more time for help with error I can´t solve. The setup is little more complicated, but I will try to introduce it in the best way. I have multiple user roles, one of them is role "member". These members have certain pages that they can edit, permission is granted during some automated process ( request for permission to edit, check if it is authorized, grant permission - via custom modules and hooks) but permission for editing is saved via module "PageEditPerUser". This pages which "member" can edit, have PageReference field, which is pointing on that user (Access - Users - Page of user) - field is called "dog_ownerSelect" and is used for loading personal data of owner = authorized user to page. Problem appears when the member is logged into processwire and he want to see pages which he can edit on live site. Return is only some error which does not seem have sense. On site traditionally error 500, because it is not superuser - output from tracydebugger error log is: [2019-11-03 10-30-56] PHP Notice: Undefined property: ProcessWire\User::$language in /nfsmnt/hosting1_1/b/5/b5ca8bf7-6179-408f-b688-09da79c8a644/daisy.sk/sub/hovawart/wire/core/PagesLoaderCache.php:236 @ https://hovawart.daisy.sk/databaza-chovu/chov/dajana-z-posonia/ When I added TracyDebugger permission to member, result: Call to a member function isDefault() on null. I am using $language in multiple places but that doesn't seem to be problem. I traced the error in file to using variable "dog_ownerSelect" in any way. <?php if(!$page->dog_ownerSelect){ } else { } ?> If there is this variable (which is pointing to user who is logged in) in any place in the file, it throws error I described. But this error occurs only if the user with role member is trying to look the page which he can edit. When you try to load page with guest or superuser or other member which doesn't have right to edit this page everything is going 100% smooth. Thank you for any suggestion where the error might be. Cheers Cehlo Link to comment Share on other sites More sharing options...
cehlo Posted April 12, 2020 Author Share Posted April 12, 2020 Maybe little bit old, but again same error. Now I can't save or edit user profile for another user than superuser. I am not currently changing by any means edit profile module nor hooking it. And this is popping out. Maybe at least some advice how to track error more precisely, because now is only forwarding me to LoaderCache and there is no problem. Thank you very much. Link to comment Share on other sites More sharing options...
cehlo Posted April 13, 2020 Author Share Posted April 13, 2020 It is very strange, when I used bardump in tracy console during this error with same line: bd($this->user->language->isDefault()) no error in tracy. I am just rubbing my head on this for like 4 hours and can't find no error or the cause of this. I even try fresh install of pw, imported database and site folder with no help. Then deleted ready file, all modules files still problem persists... Adding also some more error description from debugModelPanel. Thanks for help in advance. Link to comment Share on other sites More sharing options...
Frank Vèssia Posted April 20, 2020 Share Posted April 20, 2020 Having the same exact problem with users not superuser, can't login via API anymore because of this isDefault().... ? 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