Hi, I get the following error message when using rolereference as "normal" user. The error does not appear, when creating the node as admin. Any help on this would be most appreciated. Thank you!

user warning: Unknown column 'n.nid' in 'on clause' query: SELECT r.rid, r.name FROM role r 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 = 'og_public') OR (na.gid = 2 AND na.realm = 'term_access') OR (na.gid = 18 AND na.realm = 'term_access') OR (na.gid = 19 AND na.realm = 'term_access'))) AND ( (r.rid = 2 OR r.rid = 11 OR r.rid = 10 OR r.rid = 19 OR r.rid = 13 OR r.rid = 18) )ORDER BY r.name in /www/htdocs/xqbzzr/mm/sites/all/modules/rolereference/rolereference.module on line 614.
user warning: Unknown column 'n.nid' in 'on clause' query: SELECT r.rid, r.name FROM role r 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 = 'og_public') OR (na.gid = 2 AND na.realm = 'term_access') OR (na.gid = 18 AND na.realm = 'term_access') OR (na.gid = 19 AND na.realm = 'term_access'))) AND ( (r.rid = 2 OR r.rid = 11 OR r.rid = 10 OR r.rid = 19 OR r.rid = 13 OR r.rid = 18) )ORDER BY r.name in /www/htdocs/xqbzzr/mm/sites/all/modules/rolereference/rolereference.module on line 614.

Comments

cyu’s picture

Assigned: Unassigned » cyu
Category: support » bug

I see. The call to db_rewrite_sql() should not be there on line 613 but was probably left over from copy/paste of nodereference module. I'll fix that up, but for the time being you can remove that function call and make line 613:

$sql = "SELECT r.rid, r.name FROM {role} r $where_clause ORDER BY r.name";
lavamind’s picture

Priority: Normal » Critical

The fix seems to work for me. Could this be integrated in a release?

Raising priority to critical as this bug breaks the module with any account other than uid=1 ...

deekayen’s picture

Version: 6.x-1.0 » 6.x-1.x-dev
Status: Active » Fixed

This was already fixed in -dev. I'll make a new release node.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.