Here's there error I get:
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.g' at line 1 query: SELECT DISTINCT(n.nid), n.title FROM node n inner join content_type_sermon c on n.vid = c.vid and n.vid = c.vid where n.status <> 0 and n.type = 'sermon' and c.field_service_nid = 63 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 = 0 AND na.realm = 'content_access_author') OR (na.gid = 1 AND na.realm = 'content_access_rid'))) in /var/www/html/sites/all/modules/wwwizard_modules/modules/wwwizard_display/wwwizard_display.module on line 122.
The sql is malformed; there is an extra inner join and where clause.
Steps to duplicate:
1. add & enable content_access module
2. I enabled node-level access control for content_type = Page and made one particular page node not accessible to anonymous users. (not sure if this step is necessary to duplicate).
3. Add the "upcoming_services: Block" to your site.
4. Log out, and access a page that has the above block on it (as an anonymous user). This displays an error such as the following for each sermon you have listed.
"modules/node/node.module" implements hook_db_rewrite_sql; function node_db_rewrite_sql generates the 2nd inner join and where clause.
"wwwizard_modules/modules/wwwizard_display/wwwizard_display.module" generates the first part of the sql:
/**
* Implementation of hook_nodeapi
* Add Sermon to service if available
* Display rotating images at bottom of slideshow display
*/
function wwwizard_display_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
if (($op == 'view') && ($node->type == 'service')) {
$sermon = db_fetch_object(db_query(db_rewrite_sql("select n.nid, n.title from {node} n inner join {content_type_sermon} c on n.vid = c.vid an
d n.vid = c.vid where n.status <> 0 and n.type = 'sermon' and c.field_service_nid = %d"), $node->nid));
When I change "inner join" to "INNER JOIN" and "where" to "WHERE" in this statement, the error goes away.
Comments
Comment #1
shaisachs commentedOk, thanks! I've corrected that in the code, it will be available in the next release.