Support forums : You can sense the bug

Call to undefined function is_logged_in()

Not like "it smells funny when I click that". This is for bugs that don't show an error but something just doesn't seem right or ends up doing something you think is wrong. It doesn't show you an error but you know something ain't right.

Moderator: Dracones

Call to undefined function is_logged_in()

Postby EdB » Wed Aug 15, 2012 5:14 pm

Technically you can see this bug but you have to look in a file called error_log in the installation's root. Or, more accurately, someone running a real QP would have to look. I have it in all my QP5 installations and the source of the error is the same in QP-latest right now.

/qp_inc/_core/_misc.funcs.php:
Code: Select all
    if( ! is_logged_in() && ! $debug_visitors )
    { 
// No debug for visitors
        
return;
    } 

What I did on 2 installations is to replace the undefined function with what the undefined function does:
Code: Select all
    global $current_User;
    if( ! ( 
is_object$current_User ) && ! empty( $current_User->ID ) ) && ! $debug_visitors )
    {
        
// No debug for visitors
        
return;
    } 

Putting that in human-friendly terms: IF (current_User is an object AND that object has ID set) AND debug for visitors is not true THEN get out. That was the idea behind "debug_visitors" but we probably tested it and found no problem but didn't log out and test it and check error logs. Heck I dunno if I even get the same file created when I run on localhost.

Anyway if someone running real QP could confirm or deny this error and this fix I'll branch it up and submit it.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: Call to undefined function is_logged_in()

Postby leeturner » Wed Aug 15, 2012 8:27 pm

I have looked at a number of my live QP installs and I can't see anything in the error_log file about the is_logged_in() function.

What is the error in the log ?
leeturner
Dracone
User avatar
 
Posts: 730
Joined: Fri Dec 11, 2009 11:55 am
Location: Brighton, UK

Re: Call to undefined function is_logged_in()

Postby EdB » Wed Aug 15, 2012 9:31 pm

[11-Aug-2012 02:34:27 UTC] PHP Fatal error: Call to undefined function is_logged_in() in /...path.../qp_inc/_core/_misc.funcs.php on line 1877

The line number changes from QP to QP5 which is probably due to the header up top of the file being different. Haven't done a line-by-line to see if it is something else though.
EdB
Dracone
User avatar
 
Posts: 2072
Joined: Sun Nov 22, 2009 7:20 am
Location: Maricopa Arizona

Re: Call to undefined function is_logged_in()

Postby Kimberly » Fri Aug 17, 2012 3:51 pm

I am not even seeing an error log.
Kimberly
Dracone
User avatar
 
Posts: 842
Joined: Mon Jul 19, 2010 4:44 pm


Return to You can sense the bug

Who is online

Users browsing this forum: No registered users and 3 guests

cron