[drupal-support] node_load functionality (lots of access_denied results)

vrao vrao at misteam.net
Thu Oct 20 07:49:09 UTC 2005


Hi,

The node_load function is giving me some problems. I installed and then uninstalled node_privacy_byrole and that seems to have caused some issues.

  $node = db_fetch_object(db_query(db_rewrite_sql('SELECT n.*, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid WHERE '.\
 implode(' AND ', $cond)))); 

does not return an object when a  non admin user executes it.

I did an echo db_rewrite_sql and sure enough for an admin user the query is :

 SELECT n.*, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {users} u ON u.uid = n.uid WHERE n.nid = '19' 

for a non admin user however, its still trying to do a join with node_users

SELECT n.*, u.uid, u.name, u.picture, u.data FROM {node} n INNER JOIN {node_access} na ON na.nid = n.nid INNER JOIN {users} u ON u.uid = n.uid WHERE (na.grant_view = 1 AND CONCAT(na.realm, na.gid) IN ('all0')) AND n.nid = '9' 

what gives?

-v
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://drupal3.drupal.org/pipermail/support/attachments/20051020/bca2a1a3/attachment.htm


More information about the drupal-support mailing list