WordPress.org

Make WordPress Core

#46014 closed defect (bug) (fixed)

The 'Mine' filter on single-post comments should be filtered using $post_id

Reported by: garrett-eclipse Owned by: pento
Milestone: 5.1 Priority: normal
Severity: major Version: 5.1
Component: Comments Keywords: has-patch
Focuses: administration Cc:

Description

As @matt flagged here - https://wordpress.slack.com/archives/C02RQBWTW/p1547663425204000

The comment count beside the 'Mine' filter is incorrect when on the single-post view (i.e. edit-comments.php?p=####&comment_status=approved) as it doens't account for the $post_id from the view.

This was introduced to trunk in ticket #42379

If $post_id is set in the get_views function then it should be used to create the mine count when calling get_comments here;
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-comments-list-table.php?rev=42684#L280

This can be fixed by passing $post_id as an arg to the get_comments call.

Attachments (1)

46014.diff (562 bytes) - added by chetan200891 15 months ago.
Created patch to pass $post_id as an arg to the get_comments call.

Download all attachments as: .zip

Change History (5)

#1 @pento
15 months ago

  • Milestone changed from Awaiting Review to 5.1

@chetan200891
15 months ago

Created patch to pass $post_id as an arg to the get_comments call.

#2 @garrett-eclipse
15 months ago

  • Keywords has-patch added; needs-patch removed

Thanks @chetan200891 just wondering in the case $post_id isn't set should it be excluded from the arguments or would that matter.

#3 @pento
15 months ago

  • Owner set to pento
  • Status changed from new to assigned

#4 @pento
15 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 44631:

Comments: Correct the "Mine" comment count when viewing comments for a particular post.

The count should only be comments made on that post by the current user, not all comments by them.

Props chetan200891, garrett-eclipse.
Fixes #46014.

Note: See TracTickets for help on using tickets.