I experienced this warning when creating a node as non-admin user:
user warning: Unknown column 'n.nid' in 'on clause' query: SELECT * FROM ott_node n, ott_nodehierarchy h INNER JOIN ott_node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 1 AND na.realm = 'ogr_access') OR (na.gid = 2 AND na.realm = 'forum_access') OR (na.gid = 8 AND na.realm = 'forum_access'))) AND ((n.moderate != 1 OR n.uid = 9)) AND ( h.nid = n.nid AND h.parent = 0 AND n.type IN ('attivita_commerciale','group','group_page') )ORDER BY h.order_by ASC in /www/rbifulco/www/ottaviano/sites/all/modules/nodehierarchy/nodehierarchy.module on line 985.
I found a solution for this, but i'm not sure it's right!!
The solution is a query text rewrite in nodehierarchy.module at line 984:
I replaced the original line:
$query = "SELECT * FROM {node}, {nodehierarchy} h n WHERE h.nid = n.nid AND h.parent = %d AND n.type IN (". implode( ",", $types ) .") ORDER BY h.order_by ASC";
with
$query = "SELECT * FROM {nodehierarchy} h, {node} n WHERE h.nid = n.nid AND h.parent = %d AND n.type IN (". implode( ",", $types ) .") ORDER BY h.order_by ASC";
After this change the warning disappears and all seems to work correctly.
Comments
Comment #1
blackdog commentedThis issue is fixed in the dev-version.