Hello,

I have used Views to create a new block associated to a taxonomy ID, but with anonymous users, i have got this error on front page :

user warning: Unknown column 'node.nid' in 'on clause' query: SELECT COUNT(*) FROM (SELECT DISTINCT(node.nid) AS nid, node.title AS node_title FROM node node INNER JOIN term_node term_node ON node.vid = term_node.vid WHERE term_node.tid = 21 ) count_alias INNER JOIN node_access na ON na.nid = node.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 1 AND na.realm = 'node_privacy_byrole_role') OR (na.gid = 0 AND na.realm = 'node_privacy_byrole_user') OR (na.gid = 1 AND na.realm = 'forum_access'))) in /home.10.26/usidobn/www/modules/views/includes/view.inc on line 597.

Although i have this issue, the display of the block is correct.
With the authenticated user, i haven't got this issue.

Do you see the problem and its solution? Thanks.

Comments

merlinofchaos’s picture

Status: Active » Fixed

There appears to be a bug in core with node_db_rewrite_sql(); it is mangling the query. :/

That said I think I can add the count(*) part after the db_rewrite so that it won't have the opportunity to mess it up.

usidobn’s picture

Status: Fixed » Active

Hello,

I'm sorry but your modification hasn't got solve the problem. Now i have got:

Fatal error: Cannot use object of type stdClass as array in /home.10.26/usidobn/www/modules/views/includes/cache.inc on line 51

Thanks for your work. Good luck.

merlinofchaos’s picture

Status: Active » Fixed

Whoops. That was a different bug. Working at lightspeed trying to get to beta, and didn't notice when I tested it that I had the 'caching off' box checked, so it never did anything. I just checked in a fix.

usidobn’s picture

That's work. Thanks! :-)

Anonymous’s picture

Status: Fixed » Closed (fixed)

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