Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#49437 closed defect (bug) (duplicate)

map_meta_cap was called incorrectly on wp_dashboard()

Reported by: sebastienserre's profile sebastienserre Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Comments Keywords:
Focuses: administration Cc:

Description

Hello,
I have a notice on my WP Back Office, I don't know if it the same issue reported on #36208...

debug.log

[14-Feb-2020 17:14:59 UTC] PHP Notice:  map_meta_cap was called <strong>incorrectly</strong>. The post type scheduled-action is not registered, so it may not be reliable to check the capability "edit_post" against a post of that type. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 4.4.0.) in /var/www/XXXXX/web/wp-includes/functions.php on line 4986

with Query Monitor, I have this info in "Location":

    wp-includes/functions.php:4986
    map_meta_cap()
    wp-includes/capabilities.php:389
    map_meta_cap()
    wp-includes/class-wp-user.php:749
    WP_User->has_cap()
    wp-includes/capabilities.php:658
    current_user_can('edit_comment','86686')
    wp-admin/includes/dashboard.php:644
    _wp_dashboard_recent_comments_row()
    wp-admin/includes/dashboard.php:1016
    wp_dashboard_recent_comments()
    wp-admin/includes/dashboard.php:868
    wp_dashboard_site_activity()
    wp-admin/includes/template.php:1343
    do_meta_boxes()
    wp-admin/includes/dashboard.php:232
    wp_dashboard()
    wp-admin/index.php:148

Change History (3)

#1 @eclev91
5 years ago

Yeah, I have been meaning to put in a patch for this. It's coming from the recent comments panel. I propose that panel check that a post type exists before trying to display the comment, or in some other way display the comment minus the post information if the post type is gone.

#2 @ocean90
5 years ago

  • Component changed from General to Comments
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Yep, it’s the same as #36208.

#3 @vkbeall
5 years ago

Hello, what is the current solution for this? is it tied to a plugin?

Note: See TracTickets for help on using tickets.