Opened 10 years ago
Closed 10 years ago
#30627 closed enhancement (fixed)
Fails to update comment type using wp_update_comment
Reported by: | desaiuditd | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | 2.0 |
Component: | Comments | Keywords: | has-patch |
Focuses: | Cc: |
Description
New changes for #12668 introduces comment_type
for comments in WordPress.
When we add a new comment using wp_insert_comment
, comment_type
parameter works perfectly. It inserts a new comment with given comment type.
But when we tried to update the same comment with another comment type, the wp_update_comment
function ingnores the comment_type
parameter.
Root Cause :
Line : 2237 in wp-includes/comment.php
gathers all the valid keys for comment manipulations. Overthere comment_type
key is not added and further it will ignore the comment_type
parameter while updating the comment.
Attachments (1)
Change History (13)
This ticket was mentioned in Slack in #core by desaiuditd. View the logs.
10 years ago
#3
@
10 years ago
- Keywords dev-feedback removed
- Milestone changed from Awaiting Review to Future Release
- Version changed from trunk to 2.0
Confirmed. See also #30307.
#4
@
10 years ago
Shouldn't this go with the next 4.1 release since I'm assuming this to be a major change for comments module and any developer would expect this to work if they are updating a comment_type.
For example, in a plugin that I'm developing, I'm using WP_Comments for followups and each followup has its type let's say, Public & Private followup. Now comment author can change the type of his own followup. So he would just change the type from the UI that I've provided on the front-end and in the back-end I'm changing the comment type using wp_update_comment
.
So I think this is a valid case.
#5
@
10 years ago
Shouldn't this go with the next 4.1 release since I'm assuming this to be a major change for comments module and any developer would expect this to work if they are updating a comment_type.
This is a reasonable request, but it's not a regression in 4.1. wp_update_comment()
was introduced in r2894 and has never updated 'comment_type'. And while the flexibility of 'comment_type' is improved in r30096, it has been around for far longer.
#6
@
10 years ago
I don't think this should make any ripples even though it has been around for far longer. (9 years .. Ah ! I can only imagine.)
I strongly believe this should go in 4.1, as it was supposed to be a part of r30096. If it would have been included there was not a question at all.
This ticket was mentioned in Slack in #core by desaiuditd. View the logs.
10 years ago
#8
@
10 years ago
- Type changed from defect (bug) to enhancement
I strongly believe this should go in 4.1, as it was supposed to be a part of r30096. If it would have been included there was not a question at all.
What you're requesting here is an enhancement to wp_update_comment()
. I'm not opposed to it, and I'm happy to look at it for 4.2. But it's only peripherally related to r30096, and in any case, it's far too late in the cycle to consider any more enhancements for 4.1.
update comment type patch for #30627