See: http://api.drupal.org/api/function/hook_db_rewrite_sql/6
The implementation of hook_db_rewrite_sql() currently in modr8.module is implicitly assuming that if $primary table is not 'n', that there is not another table called 'n' in the query. That is not correct, since you are allowed to be using a different table alias.
Attached patch should fix the code to not have this assumption, and make your module more able to work well with other modules.
Note: I haven't actually tested this patch. It came up because someone using my Search by Page module was having trouble with SQL errors when Search by Page was used with ModR8. See #724500: Odd Results for Different Roles from Different Paths if you are interested.
| Comment | File | Size | Author |
|---|---|---|---|
| modr8_rewrite_sql.patch | 1.28 KB | jhodgdon |
Comments
Comment #1
pr0test0r commentedI have tested this patch with 6.x-1.1 on m dev site and it works! Thanks Jennifer, you're the best!
Comment #2
pwolanin commentedlooks mostly good, but why:
instead jsut use
$primary_tablewhere neededComment #3
jhodgdonBecause, if you notice:
If the primary table passed in isn't "node", there is a join happening, in which case primary and node tables are different.
Comment #4
pwolanin commentedAh, right - missed the last line there.
Comment #5
pwolanin commentedcommitted to 5.x and 6.x code