Groups provides group-based user membership management, group-based capabilities and content access control. It integrates standard WordPress capabilities and application-specific capabilities along with an extensive API.
GNU General Public License v3.0
49
stars
35
forks
source link
Uncaught Error: Call to undefined function get_userdata() in .../wp-includes/capabilities.php:976 #152
Not too much of a bug, just maybe an FYI of a possible edge case.
I was the other edge case that was working with that "pluggable.php" fix. I installed the new version but I'm seems I'm getting a different error but of a similar cause. Seems user_can must have been defined by groups, but get_userdata that is called in user_can was undefined.
NOTE: I WAS ALREADY LOGGED IN WHEN I PUSHED THE NEW CODEBASE. LOGGING OUT AND LOGGING BACK IN SEEMS TO RESOLVE THE ERROR. All caches were cleared after code push.
In order to logout though, I had to include pluggable in class-groups-wordpress.php in the groups_user_can method
public static function groups_user_can( $result, $groups_user, $capability, $object, $args ) {
if ( !$result ) {
// Check if the capability exists, otherwise this will
// produce a deprecation warning "Usage of user levels by plugins
// and themes is deprecated", not because we actually use a
// deprecated user level, but because it doesn't exist.
if ( Groups_Capability::read_by_capability( $capability ) ) {
if ( $groups_user instanceof Groups_User ) {
$user_id = $groups_user->get_user_id();
if ( $user_id !== null ) {
if (!function_exists('get_userdata')) {
require_once ABSPATH . WPINC . '/pluggable.php';
}
This may be a problem with already logged in users or maybe it was before the cache was flushed (redis)
Not too much of a bug, just maybe an FYI of a possible edge case.
I was the other edge case that was working with that "pluggable.php" fix. I installed the new version but I'm seems I'm getting a different error but of a similar cause. Seems user_can must have been defined by groups, but get_userdata that is called in user_can was undefined.
NOTE: I WAS ALREADY LOGGED IN WHEN I PUSHED THE NEW CODEBASE. LOGGING OUT AND LOGGING BACK IN SEEMS TO RESOLVE THE ERROR. All caches were cleared after code push.
In order to logout though, I had to include pluggable in class-groups-wordpress.php in the groups_user_can method
This may be a problem with already logged in users or maybe it was before the cache was flushed (redis)