WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 22 months ago

#21031 closed defect (bug)

map_meta_cap emits notices if $post is empty — at Version 1

Reported by: johnjamesjacoby Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Warnings/Notices Keywords: has-patch
Focuses: Cc:

Description (last modified by johnjamesjacoby)

map_meta_cap is not prepared to handle missing or invalid post ID's. To duplicate this, delete a post from the posts table without deleting its attached comments, then visit the admin dashboard with the recent comments widget visible.

Update: this isn't something that happens naturally in WordPress core, but is something plugins are able to do directly to the database, which results in orphaned comments. The attached patches only suppress debug notices PHP spits out, and does not directly address the issue of what to do with orphaned comments, should a plugin choose to do this.

Change History (3)

@johnjamesjacoby3 years ago

@johnjamesjacoby3 years ago

Related: Comments list table exhibits similar issue

comment:1 @johnjamesjacoby3 years ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.