• Hi there,

    I have started getting the following warnings in debug.log.

    The steps to reproduce:

    1. Create a custom post type with a plugin.
    2. Open wp-admin/post.php (the post editing page) of the post type.
    3. Leave the page open and disable the plugin.
    4. Wait for admin-ajax.php causes the warnings.

    [20-Jul-2014 12:27:30] PHP Notice:  Trying to get property of non-object in ...wp-includes\capabilities.php on line 1112
    [20-Jul-2014 12:27:30] PHP Stack trace:
    [20-Jul-2014 12:27:30] PHP   1. {main}() ...wp-admin\admin-ajax.php:0
    [20-Jul-2014 12:27:30] PHP   2. do_action() ...wp-admin\admin-ajax.php:82
    [20-Jul-2014 12:27:30] PHP   3. call_user_func_array() ...wp-includes\plugin.php:470
    [20-Jul-2014 12:27:30] PHP   4. wp_ajax_heartbeat() ...wp-includes\plugin.php:0
    [20-Jul-2014 12:27:30] PHP   5. apply_filters() ...wp-admin\includes\ajax-actions.php:2130
    [20-Jul-2014 12:27:30] PHP   6. call_user_func_array() ...wp-includes\plugin.php:192
    [20-Jul-2014 12:27:30] PHP   7. wp_refresh_post_lock() ...wp-includes\plugin.php:0
    [20-Jul-2014 12:27:30] PHP   8. current_user_can() ...wp-admin\includes\misc.php:723
    [20-Jul-2014 12:27:30] PHP   9. call_user_func_array() ...wp-includes\capabilities.php:1337
    [20-Jul-2014 12:27:30] PHP  10. WP_User->has_cap() ...wp-includes\capabilities.php:0
    [20-Jul-2014 12:27:30] PHP  11. call_user_func_array() ...wp-includes\capabilities.php:956
    [20-Jul-2014 12:27:30] PHP  12. map_meta_cap() ...wp-includes\capabilities.php:0
    [20-Jul-2014 12:27:30] PHP Notice:  Trying to get property of non-object in ...wp-includes\capabilities.php on line 1113
    [20-Jul-2014 12:27:30] PHP Stack trace:
    [20-Jul-2014 12:27:30] PHP   1. {main}() ...wp-admin\admin-ajax.php:0
    [20-Jul-2014 12:27:30] PHP   2. do_action() ...wp-admin\admin-ajax.php:82
    [20-Jul-2014 12:27:30] PHP   3. call_user_func_array() ...wp-includes\plugin.php:470
    [20-Jul-2014 12:27:30] PHP   4. wp_ajax_heartbeat() ...wp-includes\plugin.php:0
    [20-Jul-2014 12:27:30] PHP   5. apply_filters() ...wp-admin\includes\ajax-actions.php:2130
    [20-Jul-2014 12:27:30] PHP   6. call_user_func_array() ...wp-includes\plugin.php:192
    [20-Jul-2014 12:27:30] PHP   7. wp_refresh_post_lock() ...wp-includes\plugin.php:0
    [20-Jul-2014 12:27:30] PHP   8. current_user_can() ...wp-admin\includes\misc.php:723
    [20-Jul-2014 12:27:30] PHP   9. call_user_func_array() ...wp-includes\capabilities.php:1337
    [20-Jul-2014 12:27:30] PHP  10. WP_User->has_cap() ...wp-includes\capabilities.php:0
    [20-Jul-2014 12:27:30] PHP  11. call_user_func_array() ...wp-includes\capabilities.php:956
    [20-Jul-2014 12:27:30] PHP  12. map_meta_cap() ...wp-includes\capabilities.php:0
    [20-Jul-2014 12:27:30] PHP Notice:  Trying to get property of non-object in ...wp-includes\capabilities.php on line 1113
    [20-Jul-2014 12:27:30] PHP Stack trace:
    [20-Jul-2014 12:27:30] PHP   1. {main}() ...wp-admin\admin-ajax.php:0
    [20-Jul-2014 12:27:30] PHP   2. do_action() ...wp-admin\admin-ajax.php:82
    [20-Jul-2014 12:27:30] PHP   3. call_user_func_array() ...wp-includes\plugin.php:470
    [20-Jul-2014 12:27:30] PHP   4. wp_ajax_heartbeat() ...wp-includes\plugin.php:0
    [20-Jul-2014 12:27:30] PHP   5. apply_filters() ...wp-admin\includes\ajax-actions.php:2130
    [20-Jul-2014 12:27:30] PHP   6. call_user_func_array() ...wp-includes\plugin.php:192
    [20-Jul-2014 12:27:30] PHP   7. wp_refresh_post_lock() ...wp-includes\plugin.php:0
    [20-Jul-2014 12:27:30] PHP   8. current_user_can() ...wp-admin\includes\misc.php:723
    [20-Jul-2014 12:27:30] PHP   9. call_user_func_array() ...wp-includes\capabilities.php:1337
    [20-Jul-2014 12:27:30] PHP  10. WP_User->has_cap() ...wp-includes\capabilities.php:0
    [20-Jul-2014 12:27:30] PHP  11. call_user_func_array() ...wp-includes\capabilities.php:956
    [20-Jul-2014 12:27:30] PHP  12. map_meta_cap() ...wp-includes\capabilities.php:0
    [20-Jul-2014 12:27:30] PHP Notice:  Trying to get property of non-object in ...wp-includes\capabilities.php on line 1116
    [20-Jul-2014 12:27:30] PHP Stack trace:
    [20-Jul-2014 12:27:30] PHP   1. {main}() ...wp-admin\admin-ajax.php:0
    [20-Jul-2014 12:27:30] PHP   2. do_action() ...wp-admin\admin-ajax.php:82
    [20-Jul-2014 12:27:30] PHP   3. call_user_func_array() ...wp-includes\plugin.php:470
    [20-Jul-2014 12:27:30] PHP   4. wp_ajax_heartbeat() ...wp-includes\plugin.php:0
    [20-Jul-2014 12:27:30] PHP   5. apply_filters() ...wp-admin\includes\ajax-actions.php:2130
    [20-Jul-2014 12:27:30] PHP   6. call_user_func_array() ...wp-includes\plugin.php:192
    [20-Jul-2014 12:27:30] PHP   7. wp_refresh_post_lock() ...wp-includes\plugin.php:0
    [20-Jul-2014 12:27:30] PHP   8. current_user_can() ...wp-admin\includes\misc.php:723
    [20-Jul-2014 12:27:30] PHP   9. call_user_func_array() ...wp-includes\capabilities.php:1337
    [20-Jul-2014 12:27:30] PHP  10. WP_User->has_cap() ...wp-includes\capabilities.php:0
    [20-Jul-2014 12:27:30] PHP  11. call_user_func_array() ...wp-includes\capabilities.php:956
    [20-Jul-2014 12:27:30] PHP  12. map_meta_cap() ...wp-includes\capabilities.php:0

    I looked into the core and this is the part causing the warnings.

    $post_type = get_post_type_object( $post->post_type );
    
    		if ( ! $post_type->map_meta_cap ) {

    Simple checking of is_object( $post_type ) would prevent such an issue.

    Could somebody confirm this problem? Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I am fighting the same exact problem and to say the true I am wondering in a next future if I will not turn off that wordpress automated upgrade.

    I have turned OFF everything available and I still have this message

    Notice: Trying to get property of non-object in /hermes/bosweb25a/b57/sl.gunter/members/wp-includes/capabilities.php on line 1168

    Notice: Trying to get property of non-object in /hermes/bosweb25a/b57/sl.gunter/members/wp-includes/capabilities.php on line 1169

    Notice: Trying to get property of non-object in /hermes/bosweb25a/b57/sl.gunter/members/wp-includes/capabilities.php on line 1169

    Notice: Trying to get property of non-object in /hermes/bosweb25a/b57/sl.gunter/members/wp-includes/capabilities.php on line 1172

    Notice: Trying to get property of non-object in /hermes/bosweb25a/b57/sl.gunter/members/wp-includes/capabilities.php on line 1172

    Notice: Trying to get property of non-object in /hermes/bosweb25a/b57/sl.gunter/members/wp-includes/capabilities.php on line 1168

    Notice: Trying to get property of non-object in /hermes/bosweb25a/b57/sl.gunter/members/wp-includes/capabilities.php on line 1169

    Notice: Trying to get property of non-object in /hermes/bosweb25a/b57/sl.gunter/members/wp-includes/capabilities.php on line 1169

    Notice: Trying to get property of non-object in /hermes/bosweb25a/b57/sl.gunter/members/wp-includes/capabilities.php on line 1172

    Notice: Trying to get property of non-object in /hermes/bosweb25a/b57/sl.gunter/members/wp-includes/capabilities.php on line 1172

    Notice: Trying to get property of non-object in /hermes/bosweb25a/b57/sl.gunter/members/wp-includes/capabilities.php on line 1168

    Notice: Trying to get property of non-object in /hermes/bosweb25a/b57/sl.gunter/members/wp-includes/capabilities.php on line 1169

    Notice: Trying to get property of non-object in /hermes/bosweb25a/b57/sl.gunter/members/wp-includes/capabilities.php on line 1169

    Notice: Trying to get property of non-object in /hermes/bosweb25a/b57/sl.gunter/members/wp-includes/capabilities.php on line 1172

    Notice: Trying to get property of non-object in /hermes/bosweb25a/b57/sl.gunter/members/wp-includes/capabilities.php on line 1172

    I’m having the same issue on a fresh install.

    Trying to get property of non-object in…
    /wp-includes/capabilities.php on line 1165
    /wp-includes/capabilities.php on line 1169
    /wp-includes/capabilities.php on line 1171
    /wp-includes/capabilities.php on line 1172
    /wp-includes/capabilities.php on line 1175

    You should submit your fix to core for patching.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Trying to get property of non-object in …/capabilities.php on line 1112’ is closed to new replies.