Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Someone's reported a bug in contrib to du with use of db_rewrite_sql.
I go here and I am none the wiser: http://api.drupal.org/api/function/db_rewrite_sql
Okay, it rewrites queries -- but the function name was already a clue ;)
How does it rewrite queries? For what purpose? When, as a module developer, should I use it? How about a simple example of input vs output?
Comment | File | Size | Author |
---|---|---|---|
#5 | 444624b_D6.patch | 3.45 KB | smyleeface |
#3 | 444624_D6.patch | 2.12 KB | jhodgdon |
Comments
Comment #1
Berdirdb_rewrite_sql will be removed from D7. Instead, you can use hook_query_alter, see http://drupal.org/node/310077.
A link for D6:
http://drupal.org/node/93737
Basicallly, db_rewrite_sql allows other modules to change the query, mostly for access permissions, for example a node list.
Comment #2
jhodgdonThis function doc header should have more information, for the Drupal 6 version. It is pointless to fix it in Drupal 7, since (as noted above) the function itself is going away.
It may also be pointless to propose a patch for Drupal 6, since it doesn't seem that such patches are ever being committed to the code base. Sigh.
Comment #3
jhodgdonHere's a patch to clean up this documentation.
Comment #4
jhodgdonForgot status...
Comment #5
smyleeface CreditAttribution: smyleeface commentedLooks good; just added a blank line between all the @param and @return.
Comment #6
joachim CreditAttribution: joachim commentedLooks good.
Though there's a typo: 'collectes'.
Comment #7
jhodgdonI am cleaning up old 6.x documentation issues. At this point, we are not spending effort fixing them. Sorry.