Support » Plugin: User Role Editor » lots of warning and notices in admin panel with WP_DEBUG

  • Using the latest version at the time of this writing. If you activate WP_DEBUG, which I always do while developing, and then go to the Admin Panel > Users > All users > hover mouse on a user > click “Capabilities” … I get an immense number of PHP notices like below.

    Basically the page is full of these notices, becoming a very long scrollable page where the capabilities checkboxes are virtually lost, making the whole thing practically unusable.

    Notice: Undefined offset: 0 in /home/{USER}/public_html/web/wp-includes/capabilities.php on line 1017
    Call Stack:
        0.0006     916992   1. {main}() /home/{USER}/public_html/web/wp-admin/users.php:0
        0.0008    1044416   2. require_once('/home/{USER}/public_html/web/wp-admin/admin.php') /home/{USER}/public_html/web/wp-admin/users.php:10
        0.5287   63645000   3. do_action() /home/{USER}/public_html/web/wp-admin/admin.php:151
        0.5287   63647192   4. call_user_func_array() /home/{USER}/public_html/web/wp-includes/plugin.php:406
        0.5287   63647248   5. ure_optionsPage() /home/{USER}/public_html/web/wp-includes/plugin.php:406
        0.5294   63838176   6. require_once('/home/{USER}/public_html/web/wp-content/plugins/user-role-editor/includes/ure-options.php') /home/{USER}/public_html/web/wp-content/plugins/user-role-editor/user-role-editor.php:89
        0.5374   64075496   7. require_once('/home/{USER}/public_html/web/wp-content/plugins/user-role-editor/includes/ure-user-edit.php') /home/{USER}/public_html/web/wp-content/plugins/user-role-editor/includes/ure-options.php:311
        0.5457   64078184   8. ure_show_capabilities() /home/{USER}/public_html/web/wp-content/plugins/user-role-editor/includes/ure-user-edit.php:130
        0.5458   64079832   9. user_can() /home/{USER}/public_html/web/wp-content/plugins/user-role-editor/includes/ure-lib.php:1148
        0.5458   64087048  10. call_user_func_array() /home/{USER}/public_html/web/wp-includes/capabilities.php:1364
        0.5458   64087536  11. WP_User->has_cap() /home/{USER}/public_html/web/wp-includes/capabilities.php:1364
        0.5458   64088312  12. call_user_func_array() /home/{USER}/public_html/web/wp-includes/capabilities.php:926
        0.5458   64088928  13. map_meta_cap() /home/{USER}/public_html/web/wp-includes/capabilities.php:926
        0.5458   64091616  14. call_user_func_array() /home/{USER}/public_html/web/wp-includes/capabilities.php:1262
        0.5458   64092232  15. map_meta_cap() /home/{USER}/public_html/web/wp-includes/capabilities.php:1262

Viewing 1 replies (of 1 total)
  • Plugin Author Vladimir Garagulia


    Thanks for your help.
    I have WP_DEBUG set to true always for all my test WP instances. I never met with such output.
    As you see, problem occurs at capabilities.php, line 1017:
    $post = get_post( $args[0] );
    from map_meta_cap() function which is called from line 1262:
    return call_user_func_array( 'map_meta_cap', $args );
    and line 926:
    $caps = call_user_func_array( 'map_meta_cap', $args );
    and line 1364:
    return call_user_func_array( array( $user, 'has_cap' ), $args );
    from function user_can(). And only here we go to the URE plugin code, where at line 1148 from ure-lib.php I call user_can() function:
    if (user_can($ure_userToEdit->ID, $capability['inner'])) {

    As line 1262 at capabilities.php is related to the custom post type processing:
    // Handle meta capabilities for custom post types.
    May be something unusual was happened at your test WP instance?

    I tried to call user_can() incorrectly, with empty parameters. That doesn’t produce the output you show. If possible, please trace, what parameters URE send to user_can in your case.

    Thanks again.

Viewing 1 replies (of 1 total)
  • The topic ‘lots of warning and notices in admin panel with WP_DEBUG’ is closed to new replies.