I'm creating a view of friends content but the view shows an error:

user warning: Unknown column 'users.uid' in 'IN/ALL/ANY subquery' query: execute /* Administrador CYLdigital : execute */ SELECT activity.aid AS aid, node_activity.title AS node_activity_title, node_activity.nid AS node_activity_nid, node_activity__node_revisions.teaser AS node_activity__node_revisions_teaser, node_activity__node_revisions.format AS node_activity__node_revisions_format, activity.created AS activity_created FROM activity activity LEFT JOIN node node_activity ON activity.nid = node_activity.nid LEFT JOIN users users_activity ON activity.uid = users_activity.uid LEFT JOIN flag_friend users_activity__flag_friend ON users_activity.uid = users_activity__flag_friend.uid LEFT JOIN node_revisions node_activity__node_revisions ON node_activity.vid = node_activity__node_revisions.vid WHERE (node_activity.type in ('forum', 'article', 'image', 'story', 'video')) AND ((users.uid IN (SELECT f.friend_uid FROM flag_friend f WHERE f.uid = 1)) OR (users.uid IN (SELECT f.uid FROM flag_friend f WHERE f.friend_uid = 1))) ORDER BY activity_created DESC LIMIT 0, 5 in /var/www/dev_cyldigital_es/sites/all/modules/views/includes/view.inc on line 771.

Changing users.uid by users_activity.uid the query works fine.
How can I fix this?
Thank you.

CommentFileSizeAuthor
#12 flag_friend.827946.v1.patch2.13 KBmuhleder
#3 view.txt11.72 KBmazdakaps
#2 view.txt6.9 KBrgb0019

Comments

sirkitree’s picture

First of all, 2.x is not ready at all. Please use the 1.x release candidate. If you're still having problems, please attach an export of your view.

rgb0019’s picture

StatusFileSize
new6.9 KB

I tried to use 1.x but the activity view type did not appear.

mazdakaps’s picture

StatusFileSize
new11.72 KB

Hello having the same error but with 1.x:
user warning: Unknown column 'users.uid' in 'where clause' query: SELECT heartbeat_activity.message_id AS message_id, heartbeat_activity.message AS heartbeat_activity_message, users_heartbeat_activity.picture AS users_heartbeat_activity_picture, users_heartbeat_activity.uid AS users_heartbeat_activity_uid, users_heartbeat_activity.name AS users_heartbeat_activity_name, users_heartbeat_activity.mail AS users_heartbeat_activity_mail, users_heartbeat_activity__facebook_status.status AS users_heartbeat_activity__facebook_status_status, users_heartbeat_activity__facebook_status.uid AS users_heartbeat_activity__facebook_status_uid, users_heartbeat_activity__facebook_status.pid AS users_heartbeat_activity__facebook_status_pid, users_heartbeat_activity__facebook_status.sid AS users_heartbeat_activity__facebook_status_sid, users_heartbeat_activity__facebook_status.status_time AS users_heartbeat_activity__facebook_status_status_time, users_heartbeat_activity__fbsmp.sid AS users_heartbeat_activity__fbsmp_sid, users_heartbeat_activity__fbsmp.type AS users_heartbeat_activity__fbsmp_type, users_heartbeat_activity__fbsmp.data AS users_heartbeat_activity__fbsmp_data, users_heartbeat_activity__location.city AS users_heartbeat_activity__location_city, '' AS customfield_markup_10, heartbeat_activity.uaid AS uaid, heartbeat_activity.uid AS uid, heartbeat_activity.uid_target AS uid_target, heartbeat_activity.nid AS nid, heartbeat_activity.nid_target AS nid_target, heartbeat_activity.access AS access, heartbeat_activity.message AS message, heartbeat_activity.message_concat AS message_concat, heartbeat_activity.timestamp AS timestamp, heartbeat_activity.language AS language, heartbeat_activity.nid_info AS nid_info, heartbeat_activity.nid_target_info AS nid_target_info, heartbeat_activity.uaid_comments AS uaid_comments, heartbeat_activity.variables AS variables, heartbeat_messages_heartbeat_activity.hid AS hid, heartbeat_messages_heartbeat_activity.message AS message_orig, heartbeat_messages_heartbeat_activity.message_concat AS message_concat_orig, heartbeat_messages_heartbeat_activity.concat_args AS concat_args, heartbeat_messages_heartbeat_activity.perms AS perms, heartbeat_messages_heartbeat_activity.custom AS custom, heartbeat_messages_heartbeat_activity.description AS description, heartbeat_messages_heartbeat_activity.attachments AS attachments, heartbeat_messages_heartbeat_activity.variables AS variables_orig FROM heartbeat_activity heartbeat_activity LEFT JOIN users users_heartbeat_activity ON heartbeat_activity.uid = users_heartbeat_activity.uid LEFT JOIN heartbeat_messages heartbeat_messages_heartbeat_activity ON heartbeat_activity.message_id = heartbeat_messages_heartbeat_activity.message_id INNER JOIN facebook_status users_heartbeat_activity__facebook_status ON users_heartbeat_activity.uid = users_heartbeat_activity__facebook_status.uid LEFT JOIN flag_friend users_heartbeat_activity__flag_friend ON users_heartbeat_activity.uid = users_heartbeat_activity__flag_friend.uid INNER JOIN facebook_status users_heartbeat_activity_users_heartbeat_activity__facebook_status ON users_heartbeat_activity.uid = users_heartbeat_activity_users_heartbeat_activity__facebook_status.uid LEFT JOIN fbsmp users_heartbeat_activity__fbsmp ON users_heartbeat_activity__facebook_status.sid = users_heartbeat_activity__fbsmp.sid LEFT JOIN location_instance users_heartbeat_activity__location_instance ON users_heartbeat_activity.uid = users_heartbeat_activity__location_instance.uid LEFT JOIN location_instance users_heartbeat_activity_users_heartbeat_activity__location_instance ON users_heartbeat_activity.uid = users_heartbeat_activity_users_heartbeat_activity__location_instance.uid LEFT JOIN location users_heartbeat_activity__location ON users_heartbeat_activity__location_instance.lid = users_heartbeat_activity__location.lid WHERE ((users_heartbeat_activity__facebook_status.status) != ('')) AND ((users.uid = 0) OR (users.uid IN (SELECT f.friend_uid FROM flag_friend f WHERE f.uid = 0)) OR (users.uid IN (SELECT f.uid FROM flag_friend f WHERE f.friend_uid = 0))) ORDER BY users_heartbeat_activity__facebook_status_status_time DESC, users_heartbeat_activity__facebook_status_sid DESC LIMIT 0, 10 in /var/www/vhosts/tg-club.com/httpdocs/sites/all/modules/views/includes/view.inc on line 771.

i have a heartbeat view and using a relationship Heartbeat activity: Message owner .
Any thoughts?
Thank you

ps i attach an export of my view

mazdakaps’s picture

any help?

sirkitree’s picture

Please make sure you are using Flag 2.x and Flag Friend 2.x versions. If you're getting this error, your version are out of sync. If you are still getting this error and you have the correct versions, you may have upgraded and not run update.php. Trying running update.php if you have upgraded from pervious version. If that still does not help, try completely uninstalling both Flag and Flag Friend and re-installing with only the recommended versions.

mazdakaps’s picture

thnx ill do that

sirkitree’s picture

Status: Active » Postponed (maintainer needs more info)

Did this fix your problem?

mazdakaps’s picture

Hello and Happy new year. Yes this did fix my problem but now with flag friend 2 i have another problem . I had this patch for flag friend 1 which i used to include the argument user but now with flag friends 2 i cant use this patch anymore. And i only have the results from friends only. Except if there is another way with flag friend 2 which i cant see. Anyway thank you for your help.

sirkitree’s picture

Status: Postponed (maintainer needs more info) » Fixed

Ok, thanks. Marking this resolved. The other issue mazdakaps is referencing is: #1009344: Flag friend: Flag Friend users include argument user

Status: Fixed » Closed (fixed)

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

mazdakaps’s picture

Status: Closed (fixed) » Active

hello
since flag friends 2 not supported any more im coming back to the error using a view activity type with flag 2 and flag friends 1. The error is user warning: Unknown column 'users.uid' in 'IN/ALL/ANY subquery' and this is happening only to view types that i have to put a relationship to include the flag friend. This is also happening when i used in the past flag 1 and flag friends 1 so i think it isnt and out of sync issue.

muhleder’s picture

Status: Active » Needs work
StatusFileSize
new2.13 KB

I'm seeing the same issue with arguments accessed through relationships. Here's a quick patch which addresses the issue, I'm not sure if this is the correct way to handle this though, so marking as needs work.

mazdakaps’s picture

i just tried it and it seems to work. Ill test it more and whatever issue i have ill post it.
Thanks.

mazdakaps’s picture

Version: 6.x-2.x-dev » 6.x-1.x-dev

Hello just updated to the newest dev the same error occurs so ill use again muhleder's patch. It seems its works just fine. This error happens as muhleder said when argument (flag friends of... in my case) is accessed throught relationships.

sirkitree’s picture

Status: Needs work » Needs review

needs review

sirkitree’s picture

Status: Fixed » Closed (fixed)

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

mazdakaps’s picture

Version: 6.x-1.x-dev » 6.x-1.2
Status: Closed (fixed) » Active

Hello
im sorry im opening this because after the update i had the same problem and i noticed at the new file flag_friend_handler_argument_numeric.inc these extra lines below

 if ($this->options['flag_friend_include_arg_user']) {
      $this->query->add_where($group, "users.uid = %d", $this->argument);
    }

when is deleted these lines flag friend worked as before with no error.