Closed (fixed)
Project:
Avatar Blocks
Version:
5.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
4 Aug 2008 at 00:37 UTC
Updated:
18 Aug 2008 at 22:42 UTC
avatar_blocks.module causes:
user warning: Unknown column 'n.nid' in 'on clause' query: SELECT DISTINCT u.uid, u.name, u.picture, s.timestamp FROM users u INNER JOIN sessions s ON u.uid = s.uid 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'))) AND ( s.timestamp >= 1217799487 AND s.uid > 0 ) ORDER BY s.timestamp DESC LIMIT 0, 10
The query for user's names and pictures is wrapped in a db_rewrite_sql but this generates warnings when uid=0 (i.e. anonymous user).
http://api.drupal.org/api/function/db_rewrite_sql/5
Is db_rewrite_sql required here? My work-around is to remove the db_rewrite_sql
Comments
Comment #1
roopletheme commentedMy initial thought was that it was required. But let me revisit the code...
Comment #2
roopletheme commentedOK, after a bit of digging and some helpful advice from the #drupal IRC channel, it appears that the db_rewrite_sql statement isn't necessary. What's more, I suspect that this call is behind the problems that we've seen using AvatarBlocks with various node access modules, most notably OG Access. Fix coming...
Thanks for the amazingly specific and helpful post!
Comment #3
roopletheme commentedFixed in 1.2.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.