[wp-trac] [WordPress Trac] #14997: Single filter for all WP_Query clauses

WordPress Trac wp-trac at lists.automattic.com
Wed Oct 13 09:07:09 UTC 2010


#14997: Single filter for all WP_Query clauses
-------------------------+--------------------------------------------------
 Reporter:  scribu       |        Owner:          
     Type:  enhancement  |       Status:  reopened
 Priority:  normal       |    Milestone:  3.1     
Component:  Query        |      Version:          
 Severity:  normal       |   Resolution:          
 Keywords:  has-patch    |  
-------------------------+--------------------------------------------------

Comment(by hakre):

 Replying to [comment:17 nacin]:
 > You probably mean scribu.
 Yes, I wrote nacin but meant scribu. Too late, yester, sorry for wrong
 crediting here.

 ----

 Replying to [comment:18 scribu]:
 > Replying to [comment:15 hakre]:
 > > First patch that deals with notices attached. Removed variables fall
 back on their default values.
 >
 > That will cause more confusion than notices. Suppose you have two
 filters:
 >
 > The first one modifies JOIN and WHERE.
 >
 > The second one unsets the JOIN clause.
 >
 > You end up with an SQL error because the JOIN clause (default) no longer
 contains the tables needed for the (modified) WHERE clause.

 The problem you describe is some other problem, it's about SQL
 verification which we don't do. It is unrelated to your or my patch. You
 wrote yourself "query should fail" in such a case. As it does. Did I read
 you wrong? Please provide more detail then.

 Code should not do notices. So I fixed the code.

 Questions:

  1. Should the SQL query be syntactically verified?
  1. Should not be cared about notices any longer? (that would be new to
 me)
  2. Should an error be raised if a filter unsets/removes a clause part?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14997#comment:19>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list