[wp-trac] [WordPress Trac] #35192: Comments_clauses filter

WordPress Trac noreply at wordpress.org
Wed Jan 20 05:27:09 UTC 2016


#35192: Comments_clauses filter
--------------------------+---------------------------
 Reporter:  firebird75    |       Owner:  boonebgorges
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  4.4.2
Component:  Comments      |     Version:  4.4
 Severity:  normal        |  Resolution:  fixed
 Keywords:  fixed-major   |     Focuses:
--------------------------+---------------------------
Changes (by dd32):

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


Comment:

 In [changeset:"36357"]:
 {{{
 #!CommitTicketReference repository="" revision="36357"
 Comments: Use the post-filter WHERE clause when querying for comment
 descendants.

 The descendant query in `WP_Comment_Query::fill_descendants()` uses the
 clauses
 of the main `get_comment_ids()` query as a basis, discarding the `parent`,
 `parent__in`, and `parent__not_in` clauses. As implemented in WP 4.4
 [34546],
 the WHERE clause was assembled in such a way that any modifications
 applied
 using the `comments_clauses` filter were not inherited by
 `fill_descendants()`.
 This resulted in descendant queries that did not always properly filter
 results, and sometimes contained syntax errors.

 The current changeset fixes the problem by using the post-filter WHERE
 clause
 as the basis for the `fill_descendants()` query. This change requires a
 new
 approach for eliminating the unneeded parent-related clauses: instead of
 eliminating values in an associative array, we must use regular
 expressions.

 Merges [36277] to the 4.4 branch.
 Props boonebgorges, firebird75.
 Fixes #35192.
 }}}

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


More information about the wp-trac mailing list