Jump to content

[SOLVED] What does this mean - Uncaught Error: Call to a member function isLoggedin() ?


modifiedcontent
 Share

Recommended Posts

Another very dumb basic question; what could this error mean?

Quote

Fatal Error:     Uncaught Error: Call to a member function isLoggedin() on string in ... 

Followed by a whole bunch of file addresses. Can someone translate this error; what should I check?

I am troubleshooting a custom login/register system. I get this error when I enter gibberish in the username login field to produce a nice 'wrong username or password' message. A 'forgot password' form on the same page, not displayed while logging in, gets the 500 Internal Server Error. 

Link to comment
Share on other sites

Basically, you are doing something like this:

<?php namespace ProcessWire;

$someVariable->isLoggedin();
// BUT the value of $someVariable is a string, e.g. "some_string"
// IT NEEDS to be an object of type User

Hence, you get an error since a string cannot have properties or methods (functions). It would have been better to see your code ( your custom login/register system. ) but even without that, what you need to do is to check if $someVariable is an object of type User before calling isLoggedin() on it. 

Edited by kongondo
clarification
  • Like 2
  • Thanks 1
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...