Jump to content

Superuser ID is not 41


asbjorn
 Share

Recommended Posts

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

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.

  • Like 1
Link to comment
Share on other sites

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

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