Closed (fixed)
Project:
Recipe
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Feb 2005 at 23:48 UTC
Updated:
25 Mar 2005 at 03:15 UTC
recipe.module,v 1.31.2.5 2004/12/08
when anonymous user access http://sitename/recipe, the following error occurs,
Fatal error: You have an error in your SQL syntax near 'ON (na.nid = 0 OR na.nid = n.nid) WHERE na.grant_view = 1 AND CONCAT(na.realm, n' at line 1 query: SELECT COUNT(*) FROM node n INNER JOIN users u ON n.uid=u.uid INNER JOIN recipe r ON n.nid = r.nidINNER JOIN node_access na ON (na.nid = 0 OR na.nid = n.nid) WHERE na.grant_view = 1 AND CONCAT(na.realm, na.gid) IN ('all0') AND n.type = 'recipe' in includes/database.mysql.inc on line 125
Comments
Comment #1
DrMoxie commentedUsers other than the administrator account encounter the following error when visiting ?q=recipe:
user error: Unknown column 'r.nidINNER' in 'on clause' query: SELECT COUNT(*) FROM node n INNER JOIN users u ON n.uid=u.uid INNER JOIN recipe r ON n.nid = r.nidINNER JOIN node_access na ON (na.nid = 0 OR na.nid = n.nid) WHERE na.grant_view = 1 AND CONCAT(na.realm, na.gid) IN ('all0') AND n.type = 'recipe' in /var/www/snacky/includes/database.mysql.inc on line 125.
Is there a fix for this? It appears to be permissions based....
Comment #2
gkrishna commentedin function_recipe_list() {
replace $result = "... sql query "
with
$result = pager_query("SELECT n.nid, n.title, n.uid, u.name, r.notes FROM {node} n INNER JOIN {users} u ON n.uid=u.uid INNER JOIN {recipe} r ON n.nid = r.nid WHERE n.type = 'recipe' ORDER BY n.created DESC", 20);
Comment #3
yelvington commentedI've encountered similar problems -- SQL queries where spaces are omitted -- in interactions among several modules. Recipe, events and gallery2 come to mind. It begins to point to some fundamental bug, but I don't have enough evidence yet and don't understand enough about how SQL queries are constructed internally.
Comment #4
moshe weitzman commentedfixed in HEAD
Comment #5
syscrusher commentedI posted a patch with this issue: http://drupal.org/node/18718 which fixes the problem in 4.5 (not HEAD) that was reported in follow up #1 by DrMoxie here.
Comment #6
(not verified) commented