Make WordPress Core

Opened 13 years ago

Closed 10 years ago

#24648 closed defect (bug) (fixed)

Don't exclude uneditable comments in wp_ajax_get_comments

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

Description

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 13 years ago.
24648.2.patch​ (606 bytes ) - added by rachelbaker 10 years ago.
Show only approved comments if the current user cannot edit the comment

Download all attachments as: .zip

Change History (11)

@jfarthing84
13 years ago

#1 @SergeyBiryukov
13 years ago

  • Version trunk → 3.3

Introduced in [18435].

#2 @chriscct7
11 years ago

  • Type enhancement → defect (bug)

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


10 years ago

#4 @rachelbaker
10 years ago

  • Keywords needs-testing added; dev-feedback removed
  • Milestone Awaiting Review → 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.

@rachelbaker
10 years ago

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

#6 @rachelbaker
10 years ago

  • Milestone Future Release → 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
10 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
10 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
10 years ago

  • Owner set to rachelbaker
  • Resolution → fixed
  • Status new → 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.