Closed (duplicate)
Project:
Flag
Version:
6.x-1.1
Component:
Views integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Jul 2009 at 18:51 UTC
Updated:
3 Sep 2010 at 03:35 UTC
user warning: Unknown column 'users.nid' in 'field list' query: SELECT users.uid AS uid, users.name AS users_name, content_id, users.nid AS users_nid FROM users users INNER JOIN flag_content flag_content_users ON users.uid = flag_content_users.uid AND flag_content_users.fid = 3 LIMIT 0, 10 in /www/drupal/sites/all/modules/views/includes/view.inc on line 755.
It seems to me that the column should be users.uid not users.nid, but I don't know drupal enough to be sure. Anyway it looks like to be a bug since the module should not generate incorrect SQL requests.
Comments
Comment #1
quicksketchI'm not sure if this is a fixable problem. This error only occurs if when setting up your relationship you select a node-flag. Since there is no node available to do the query when starting with a user-view, the SQL error results. If you set up a relationship and select a user-flag, everything works just fine.
So the logical thing might seem to be to remove the node-flags from the list of flags when adding the relationship. However adding a node-flag is still allowed as long as a node-relationship has been added first, so we can't just remove the option entirely. The only thing we could do I think is to give the user a validation error, saying that they configured the view incorrectly by using a node-flag within a user-view.
Comment #2
quicksketchI was trying to solve this problem but I can't get Views to not execute the query and prevent errors from displaying. For now, I think the solution is just "don't do that". Adding a node-based flag to a user-list just won't work for the mean time until I can figure out how to prevent the Ops field from being listed at all.
Comment #3
R.Hendel commentedHello,
I have found this error in node views too.
Here is exported views code.
Hope that helps...
Comment #4
R.Hendel commented#3 was my own mistake: I chosed wrong relation type.
Comment #5
mooffie commentedMarking this a dup of:
#901120: Views validation: invalid Ops