[development] db_rewrite_sql question

Rob Barreca rob at electronicinsight.com
Tue Aug 15 22:47:52 UTC 2006


What about that last param in db_rewrite_sql() for extra args? I've been 
working on a massive Tagadelic patch (ugh...) and have passed in 
array('omit_check' => 'tagadelic') for certain db_rewrite_sql calls that 
I don't want passing through taxonomy visibility settings. It's probably 
not the most desirable solution, but has worked for the time being. I 
don't think this is what that last param in db_rewrite_sql() is designed 
for this, but I could be wrong.

Rob Roy Barreca
Founder and COO
Electronic Insight Corporation
http://www.electronicinsight.com
rob at electronicinsight.com



Nedjo Rogers wrote:
>> What's a module to do when it recieves two calls to 
>> hook_db_rewrite_sql; in
>> both cases $primary_field is 'cid' and $primary_table is 'c', but in 
>> one case
>> the query needs re-writing and in the other it does not?
>
> You could, awkwardly, test the full $query for your table's name and 
> alias, e.g.
>
> if (strstr($query, '{category} c')) {
>
> }
>


More information about the development mailing list