1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HOWTO: Fix XML-RPC Error in WordPress 3.7.1 and XenForo 1.2.3

ErrorException: Fatal Error: Call to a member function exists() on a non-object

  1. LPH
    After an upgrade to WordPress 3.7.1 and XenForo 1.2.3, an error appears in the server log.

    Code (Text):
    1.  
    2. ErrorException: Fatal Error: Call to a member function exists() on a non-object - /path/to/wp-includes/pluggable.php:730
    3. Generated by: Unknown account
    4. Follow up
    5. #0 [internal function]: XenForo_Application::handleFatalError()
    6. #1 {main}
    7. Request state
    8. array(3) {
    9. ["url"] => string(31) "http://YOURSITE.com/xmlrpc.php"
    10. ["_GET"] => array(0) {
    11. }
    12. ["_POST"] => array(0) {
    13. }
    14. }
    15.  
    This error may be fixed by changing the get_currentuserinfo() function in the file /include/xf_replacement_user_functions.php

    Change this line:
    Code (Text):
    1.  
    2. if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST )
    3.      return false;
    4.  
    To this new line:
    Code (Text):
    1.  
    2.   if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) {
    3.      wp_set_current_user( 0 );
    4.      return false;
    5.    }
    6.  
    Digital Doctor likes this.