The only way I can see that happening is if another plugin is resetting the $GLOBALS[‘current_user’] variable following Role Scoper initialization. I could give you some code for a more graceful failure, but until we stop current_user from being wiped, RS won’t be able to do its job.
Start by searching all your plugin code for this:
new WP_User
Sorry to bump an older thread but I also receive a fatal error when I activate Role Scoper in WP 3.0.1:
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'stdClass::has_cap' was given in /home/feliciac/public_html/wpsnippets/uao/wp-includes/capabilities.php on line 1067
Fatal error: Call to undefined method stdClass::user_can_for_any_object() in /home/feliciac/public_html/wpsnippets/uao/wp-content/plugins/role-scoper/admin/permission_lib_rs.php on line 134
I de-activated all the installed plugins, and also cleared my theme functions.php file just in case, so am a little bit puzzled.
Any help would be much appreciated! 🙂
Are you running Role Scoper version 1.2.7, and seeing this when all plugins except Role Scoper are deactivated? Also after switching temporarily to the default theme?
Does it occur right after you activate Role Scoper, with other wp-admin URL(s), or both?
Is this a Multisite installation? If so, are you logged as a limited administrator (not a super admin of all sites)?
Something strange is happening on your installation because normally the code that generated that error would not even execute for a logged Administrator (which you presumably are to activate the plugin).
To help me diagnose this, can you temporarily modify permission_lib_rs.php as follows:
change:
if ( $reqd_caps = array_merge( array_keys($admin_caps), array_keys($delete_caps) ) ) {
if ( ! defined('DISABLE_QUERYFILTERS_RS') && $scoper->cap_interceptor->user_can_for_any_object( $reqd_caps ) )
$return = true;
}
to:
if ( $reqd_caps = array_merge( array_keys($admin_caps), array_keys($delete_caps) ) ) {
if( ! method_exists( $scoper->cap_interceptor, 'user_can_for_any_object' ) )
agp_bt_die();
if ( ! defined('DISABLE_QUERYFILTERS_RS') && $scoper->cap_interceptor->user_can_for_any_object( $reqd_caps ) )
$return = true;
}
You will also need to temporarily add this to wp-config.php, above the “stop editing” line:
define( 'RS_DEBUG', true );