Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#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:


As @matt flagged here -

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;

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 3 years 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
3 years ago

  • Milestone changed from Awaiting Review to 5.1

3 years ago

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

#2 @garrett-eclipse
3 years 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
3 years ago

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

#4 @pento
3 years 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.