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?

CommentFileSizeAuthor
#5 444624b_D6.patch3.45 KBsmyleeface
#3 444624_D6.patch2.12 KBjhodgdon
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

db_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.

jhodgdon’s picture

Version: 7.x-dev » 6.x-dev

This 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.

jhodgdon’s picture

FileSize
2.12 KB

Here's a patch to clean up this documentation.

jhodgdon’s picture

Status: Active » Needs review

Forgot status...

smyleeface’s picture

FileSize
3.45 KB

Looks good; just added a blank line between all the @param and @return.

joachim’s picture

Status: Needs review » Needs work

Looks good.

Though there's a typo: 'collectes'.

jhodgdon’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

I am cleaning up old 6.x documentation issues. At this point, we are not spending effort fixing them. Sorry.