[wp-trac] [WordPress Trac] #49236: Use 'comment' instead of '' for the comment_type db field for comments

WordPress Trac noreply at wordpress.org
Sat Apr 18 08:27:47 UTC 2020


#49236: Use 'comment' instead of '' for the comment_type db field for comments
--------------------------------------------+-----------------------------
 Reporter:  imath                           |       Owner:  SergeyBiryukov
     Type:  enhancement                     |      Status:  reopened
 Priority:  normal                          |   Milestone:  5.5
Component:  Comments                        |     Version:  5.4
 Severity:  normal                          |  Resolution:
 Keywords:  has-patch early needs-dev-note  |     Focuses:
--------------------------------------------+-----------------------------
Changes (by ocean90):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 I'm seeing two issues in [47597]:

 * `wp_insert_comment( [ 'comment_type' => '' ] );` will still insert an
 empty string due to the `isset()` check.
 * In `WP_Comment_Query::get_comment_ids()` the previous `$comment_types[
 $operator ][] = "''";` line needs to be restored otherwise not yet
 migrated comments will be missing when using `get_comments( [ 'type' =>
 'comment' ] )`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49236#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list