asbjorn Posted December 18, 2015 Share Posted December 18, 2015 I seem to have a problem because my superuser does not have 41 as ID (but 1074). I have no idea how this happened, but I have been moving this installation around during development. Anyway, is there a way to change this back? Link to comment Share on other sites More sharing options...
horst Posted December 18, 2015 Share Posted December 18, 2015 Is this the only superuser you have, or do you have multiple superusers? Link to comment Share on other sites More sharing options...
asbjorn Posted December 18, 2015 Author Share Posted December 18, 2015 I had one. I can easily make more. None of them have id 41 or get when I create new users. The reason I'm asking is because of an notice I get: Notice: Trying to get property of non-object in /Users/ness/framework.pw/wire/core/Page.php on line 1211 I thought it was an v3 error, but when I reported it I was told it was because of no superuser with id 41. Link to comment Share on other sites More sharing options...
kixe Posted December 19, 2015 Share Posted December 19, 2015 Some useful API Stuff: $config->superUserPageID // return int (Super User ID) $config->guestUserPageID // return int (Guest User ID) $user->isSuperuser() // return bool $user->hasRole('superuser') // return bool to check for any role $user->isLoggedin() // return bool $user->isGuest() // return bool Normally you cannot delete the superuser. Is there a change of Super User ID in your config file?Check if superuser exists with var_dump($pages->get(41)->name) // should return string like 'admin' or so If there is no page with ID 41 only solution is to manipulate your database and set the superuser page back to ID 41. 1 Link to comment Share on other sites More sharing options...
asbjorn Posted December 20, 2015 Author Share Posted December 20, 2015 Thanks kixe. My solution: I checked with a couple of your lines of code. There was no change of super user ID in my config file. I would have had to manipulate my database, I guess. But I ended up spending a little extra time to setup a new installation (copying files, export/import templates and field, and modules). This was all for my own "base installation", and I would rather not come across errors related to this (or how I 'fixed' it) in the future. But knowing there's an answer is always a great part of the ProcessWire learning process for me. 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