Make WordPress Core

Opened 7 years ago

Closed 4 years ago

#24648 closed defect (bug) (fixed)

Don't exclude uneditable comments in wp_ajax_get_comments

Reported by: jfarthing84 Owned by: rachelbaker
Milestone: 4.6 Priority: normal
Severity: normal Version: 3.3
Component: Comments Keywords: has-patch
Focuses: Cc:


The editing links will not be shown in the row actions anyway, if the user cannot edit that comment. Why not display the comment?

Attachments (2)

24648.patch (493 bytes) - added by jfarthing84 7 years ago.
24648.2.patch (606 bytes) - added by rachelbaker 4 years ago.
Show only approved comments if the current user cannot edit the comment

Download all attachments as: .zip

Change History (11)

7 years ago

#1 @SergeyBiryukov
7 years ago

  • Version changed from trunk to 3.3

Introduced in [18435].

#2 @chriscct7
5 years ago

  • Type changed from enhancement to defect (bug)

This ticket was mentioned in Slack in #core-comments by rachelbaker. View the logs.

4 years ago

#4 @rachelbaker
4 years ago

  • Keywords needs-testing added; dev-feedback removed
  • Milestone changed from Awaiting Review to Future Release

Looks like in wp_dashboard_recent_comments() we display a comment if the user has read_post. As long as un-approved comments aren't being shown the edit_comment capability check isn't needed.

4 years ago

Show only approved comments if the current user cannot edit the comment

#6 @rachelbaker
4 years ago

  • Milestone changed from Future Release to 4.6

In 24648.2.patch I kept the conditional capability check, but allow approved comments to be viewed. This matches the behavior of the Recent Comments dashboard widget.

@jfarthing84 Does this logic make sense to you?

#7 @jfarthing84
4 years ago

Given this was over 3+ years ago - I forget my original intention. But, that's definitely better than what's there now.

#8 @rachelbaker
4 years ago

  • Keywords needs-testing removed

@jfarthing84 I understand, thank you for taking a look. I have tested the patch, and it fits with other logic we have for displaying comments in the dashboard.

#9 @rachelbaker
4 years ago

  • Owner set to rachelbaker
  • Resolution set to fixed
  • Status changed from new to closed

In 37584:

Comments: Display approved comments on the Edit Post screen to users without the edit_comment capability.

Matches logic in wp_dashboard_recent_comments() where we display approved comments regardless of the edit permission.

Props jfarthing84 for initial patch.
Fixes #24648.

Note: See TracTickets for help on using tickets.