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

WordPress Trac noreply at wordpress.org
Sat Jan 9 04:01:19 UTC 2016


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

 * keywords:   => has-patch


Comment:

 Okey dokey: [attachment:35192.2.diff] is a more general way to process the
 post-filter SQL. Basically, I excise the 'parent' etc clauses, including
 any AND that precedes or trails them, then I reassemble the WHERE clause,
 adding ANDs as necessary. A couple of tests demonstrate that proper syntax
 is maintained.

 This approach should allow 'comments_clauses' filters to continue to work
 as they did prior to 4.4, since the SQL that comes out of that filter is
 the same SQL (with some mods) that is used to fetch children in
 `fill_descendants()`.

 @firebird75 Any chance you could apply this to your test environment to be
 sure it's generating the proper results?

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


More information about the wp-trac mailing list