WordPress.org

Making WordPress.org

Opened 9 months ago

Closed 8 months ago

#2668 closed defect (fixed)

Plugin Directory Admin: Replies to internal notes have the wrong comment type

Reported by: ocean90 Owned by: coffee2code
Milestone: Plugin Directory v3.0 Priority: high
Component: Plugin Directory Keywords: has-patch commit
Cc:

Description

WordPressdotorg\Plugin_Directory\Admin\Customizations::save_custom_comment() (or wp_ajax_replyto_comment() sets the type if $_POST['comment_type'] is set but wp_comment_reply() doesn't define a comment_type field.

To make it work on edit.php and edit-comments.php we could add a check to preprocess_comment which sets comment_type if $commentdata['comment_parent'] is an ID for an internal note.

Attachments (3)

2668.patch (2.7 KB) - added by SergeyBiryukov 8 months ago.
2668.2.patch (4.3 KB) - added by SergeyBiryukov 8 months ago.
2668.3.patch (3.1 KB) - added by SergeyBiryukov 8 months ago.

Download all attachments as: .zip

Change History (8)

#1 @SergeyBiryukov
8 months ago

  • Keywords has-patch commit added; needs-patch removed

There's a code to add the comment_type field in js/edit-form.js, but it doesn't account for replies, and it adds duplicate fields when clicking the "Add note" button several times.

2668.patch fixes both issues.

#2 @SergeyBiryukov
8 months ago

To make it work on edit.php and edit-comments.php we could add a check to preprocess_comment which sets comment_type if $commentdata['comment_parent'] is an ID for an internal note.

I think we could just inherit comment type from parent comment in ::save_custom_comment(), see 2668.2.patch (also includes the patch from #2667).

#3 @SergeyBiryukov
8 months ago

Refreshed after [5308].

#4 @Ipstenu
8 months ago

  • Summary changed from Replies to internal notes have the wrong comment type to Plugin Directory Admin: Replies to internal notes have the wrong comment type

#5 @coffee2code
8 months ago

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

In 5335:

Plugin Directory: Ensure replies to internal notes are assigned the proper comment_type when made outside of the edit plugin page.

Props SergeyBiryukov.
Fixes #2668.

Note: See TracTickets for help on using tickets.