[development] Restricting hook_db_rewrite_sql

Earl Miles merlin at logrus.com
Sun Apr 16 18:14:31 UTC 2006


Rob Thorne wrote:
> I'm having problems getting hook_db_rewrite_sql to restrict its actions 
> to queries where it has business rewriting, and am having difficulty 
> figuring how what to look at in order to do this.
> 
> Here's the use case.  I have two node types  (call them 
> "civinode_contact" and "civinode_access")  that I want viewable 
> according to a couple of tables that test the current user.  This now 
> works (i.e., it makes the right join and does the test I want),  but it 
> also tries to rewrite the query that og.module creates to do its own 
> listing in www.example.com/og, at least for the anonymous user:

That's primarily because most node queries are type agnostic. That's why there 
is a node_access table.


More information about the development mailing list