Active
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
user data
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Oct 2011 at 01:25 UTC
Updated:
25 Apr 2012 at 20:09 UTC
this issue seems to have been known for a while (#1272786: Exception: Query tagged for node access but there is no nid...) but i don't see it raised on Views yet; i am just listing it here to keep a record.
yes, i know, a test View would be useful, i will try to create one off a clean drupal install.
from the post listed above i think the basic idea is that:
- user view
- relationship defined
- sql rewrite enabled (disabling this removes error condition)
throws this exception error in the node.module:
Exception: Query tagged for node access but there is no nid. Add foreign keys to node.nid in schema to fix. in _node_query_node_access_alter() (line 3218 of E:\wamp\www\mit\modules\node\node.module).
for any non admin role (possibly more specific than this) trying to access a page that would display this view (even if the view has no results and is not rendered).
Comments
Comment #1
dawehnerOh man, how often did you questions the following thing to you?
Can you please export your view? Thanks!
Anyway i think this is a duplicate of #1222324: Fix query access control on relationships (comments)
Comment #2
liquidcms commentedhey, dont shoot the messenger.. lol.. i am just logging this issue since 4 or 5 other people have reported in general forums and i thought it should be posted in Views queue since it seemed pretty obvious a views issue. also, never quite get what you are looking for for an export since you can't import this.. but i guess can still see a lot in the txt of the export.
so here is export.. BUT.. this view DOES work ok.. because it has the sql rewrite disabled; but enabling it as it should be and the view will cause exception error if not admin.
Comment #3
esmerel commentedComment #4
dawehnerI'm sorry here but things get really frustrating from time to time.
I see a problem though i don't see a real solution, adding no access tags would also break things mh. There was another issue which allows to configure this per relationship
Comment #5
dawehnerThe other issue I talked about is #1222324: Fix query access control on relationships (comments)
The problem is that the node table is never joined in, as the fieldapi field just needs the entity id, which exists just on the field table. Maybe something has to force to add the base table id in that case, though i'm not sure how to do this without getting a performance problem, because of the additional join, back.