Does not work with webserver_auth module + CCK (user reference) module together
| Project: | Nodeaccess |
| Version: | 6.x-1.3 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
I'm using my own authentication under my webserver so I use the webserver_auth module to authenticate my users. When i install nodeaccess and click on My Account I get this gigantic error. See below:
* 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 'AND realm = 'nodeaccess_uid') OR (gid = AND realm = 'nodeaccess_author')) AND g' at line 1 query: SELECT COUNT(*) FROM node_access WHERE nid = 0 AND ((gid = 0 AND realm = 'all') OR (gid = -1 AND realm = 'nodeaccess_rid') OR (gid = AND realm = 'nodeaccess_uid') OR (gid = AND realm = 'nodeaccess_author')) AND grant_view >= 1 in /srv/www/modules/node/node.module on line 2161.
* warning: array_fill() [function.array-fill]: Number of elements must be positive in /srv/www/includes/database.inc on line 241.
* warning: implode() [function.implode]: Invalid arguments passed in /srv/www/includes/database.inc on line 241.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /srv/www/modules/user/user.module on line 502.
* 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 ')' at line 1 query: SELECT p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /srv/www/modules/user/user.module on line 502.
* 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 'AND na.realm = 'nodeaccess_uid') OR (na.gid = AND na.realm = 'nodeaccess_author' at line 1 query: SELECT DISTINCT(n.nid), n.title, n.type FROM node n LEFT JOIN content_type_contact f ON n.vid = f.vid 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 = -1 AND na.realm = 'nodeaccess_rid') OR (na.gid = AND na.realm = 'nodeaccess_uid') OR (na.gid = AND na.realm = 'nodeaccess_author'))) AND ( f.field_user_uid=1 AND n.status = 1) in /srv/www/modules/cck/modules/userreference/userreference.module on line 858.
I'm not even sure if nodeaccess is even working at this point.
I have had trouble trying to duplicate this issue from scratch but I think I figured it out. Here are the modules needed to duplicate the issue:
Drupal 6.10 - of course
CCK - with User Reference enabled
webserver_auth - It needs to actually be used as the authentication in order to get the error. Just having it installed won't cause it
Now create a new content type called 'Contact' and add a User Reference field...call it user or whatever you want, configure it and make sure Reverse link is checked.
Then click over on My Account and you should get the error.
If you go back to the content type you created and uncheck Reverse link the error does not occur.
In my opinion I think the issue is how nodeaccess relates to the userreference module. But I cannot be sure.

#1
Just an update to the title