Make WordPress Core

Opened 13 years ago

Closed 11 years ago

Last modified 11 years ago

#21031 closed defect (bug) (duplicate)

Orphaned comments emit debug notices in dashboard and comments lists

Reported by: johnjamesjacoby's profile 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.

The comments list table exhibits a similar issue, where the $post global is assumed to be set and valid.

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.

Attachments (2)

21031.patch (1.6 KB) - added by johnjamesjacoby 13 years ago.
21031.2.patch (3.4 KB) - added by johnjamesjacoby 13 years ago.
Related: Comments list table exhibits similar issue

Download all attachments as: .zip

Change History (7)

@johnjamesjacoby
13 years ago

Related: Comments list table exhibits similar issue

#1 @johnjamesjacoby
13 years ago

  • Description modified (diff)

#2 @johnjamesjacoby
13 years ago

  • Description modified (diff)
  • Summary changed from map_meta_cap emits notices if $post is empty to Orphaned comments emit debug notices in dashboard and comments lists

#3 @ocean90
13 years ago

Related/Duplicate: #16956, #16651, #19590

#4 @c3mdigital
11 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #13905.

#5 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.