Possible conflict with Content Access module
| Project: | Flash Node |
| Version: | 6.x-3.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
I'm using this great module, and it works like a charm...except when I use it in combination with the Content Access module. In particular, I am using PHP to pull some data from custom database tables to pass to my Flash file using the "Advanced flash node options." This all works fine when I do not have the Content Access module enabled. However, when I enable Content Access and then restrict access to my Flash node to a particular role, it appears that the query being conducted by my custom PHP for the flash node is somehow getting mixed up with the access query being conducted by Content Access, and I receive the following error message:
user warning: Unknown column 'n.nid' in 'on clause' query: SELECT COUNT(*) FROM custom_table INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 28 AND na.realm = 'content_access_author') OR (na.gid = 2 AND na.realm = 'content_access_rid') OR (na.gid = 11 AND na.realm = 'content_access_rid'))) AND ( uid =28 AND program_id = 'custom') in /home/me/public_html/includes/common.inc(1685) : eval()'d code on line 12.Most of this query is presumably from Content Access, but some parts of it (such as the "custom_table" and the "uid =28 AND program_id = 'custom'") are from my flash node query. When I disable Content Access, the error goes away and my query works and is passed to the flash file appropriately.
Any ideas? If it helps for troubleshooting, I also experienced a similar error (with queries apparently mashed together) when I had the Site Notes module enabled (but it wasn't vital to my site, so I just uninstalled it). This is on a Drupal 6.14 installation.

#1
#2
The problem is probably between your custom PHP code and the Content Access. Without seeing your code it is otherwise a wild guess (I would guess you are calling db_rewrite_sql).
#3
Ah, that was it. I removed the db_rewrite_sql and all is well now. Thanks, nevets.