[wp-trac] [WordPress Trac] #33170: get_comments interface doesn't return comments with 'comment' type

WordPress Trac noreply at wordpress.org
Sat Aug 29 03:30:19 UTC 2015


#33170: get_comments interface doesn't return comments with 'comment' type
-------------------------------+------------------------------
 Reporter:  caramon            |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Query              |     Version:  4.2.3
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by boonebgorges):

 * keywords:   => reporter-feedback


Comment:

 Hi caramon - Thanks for the report, and welcome to WordPress Trac!

 > After some debugging I found that the call above sends invalid SQL query
 to DB.

 `comment_type IN ('')` is not invalid SQL. It looks for rows where the
 `comment_type` field is an empty string.

 > In the DB records wp_comment.comment_type has 'comment' value, so it
 simply doesn't match to SQL that WP generates.

 Normal WordPress comments - those created via wp-comments-post.php - have
 `comment_type = ''`. See
 https://core.trac.wordpress.org/browser/tags/4.3/src/wp-comments-
 post.php?marks=119#L118. If you have records in your database where the
 value in the `comment_type` field is 'comment', it might be a plugin at
 work. Can you verify this behavior with all plugins disabled?

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


More information about the wp-trac mailing list