Message User notice:

'Exception: SQLSTATE[23000]: Integrity constraint violation: 1052 Column \'uid\' in field list is ambiguous'

in views_plugin_query_default->execute() (line 1346 of /home/hoslot5/public_html/sites/all/modules/views/plugins/views_plugin_query_default.inc).

Additionally, the bookmarked content does not show up in the user profile.

Comments

drupallogic’s picture

same here.

mylesorme’s picture

Version: 7.x-2.x-dev » 7.x-2.0-beta5

Similarly on a new installation with no content.

tj2653’s picture

Not sure if this is the same problem, but I occasionally get a similar message when flagging (Flag 7.x-2.0-beta5):

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-2' for key 'PRIMARY': INSERT INTO {flag_counts} (fid, content_type, content_id, count) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => 2 [:db_insert_placeholder_1] => node [:db_insert_placeholder_2] => 2 [:db_insert_placeholder_3] => 1 ) in flag_flag->_update_count() (line 743 of /home/my/public_html/sites/all/modules/flag/flag.inc).

mefisto75’s picture

I have exactly the same problem but isn't this a duplicate of http://drupal.org/node/1047954

quicksketch’s picture

simon_s’s picture

Version: 7.x-2.0-beta5 » 7.x-2.0-beta6
Status: Closed (duplicate) » Active

I have a similar problem, but within the flac.inc file: (used version 7.x-2.0-beta6)
I'm flagging anonymous node visits (for a list of recently viewed products) using the rules module and executing these 3 flag api calls within a rule:
$flag = flag_get_flag('recently_viewed');
// Unflag node first to refresh flagging time)
$flag->flag('unflag', $node->nid);
// Flag node
$flag->flag('flag', $node->nid);

Sometimes (I haven't found a clear regularity behind it yet) an error like this thrown:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-4' for key 1: INSERT INTO {flag_counts} (fid, content_type, content_id, count) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => 2 [:db_insert_placeholder_1] => node [:db_insert_placeholder_2] => 4 [:db_insert_placeholder_3] => 2 ) in flag_flag->_update_count() (line 738 of /home/www/drupal7/sites/all/modules/flag/flag.inc).

Thanks for your help and for this great module!

Scott Ellis’s picture

Hello, I believe I'm having the same problem as described in #6 except I'm not using the Rules module. I'm not sure if this is considered an open issue under beta6 or whether it should be opened as a new issue (or if I'm an idiot for asking because it's been resolved elsewhere), so I'll just describe my observations briefly and await further instruction.

My error message is this:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-103' for key 1: INSERT INTO {flag_counts} (fid, content_type, content_id, count) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => 2 [:db_insert_placeholder_1] => node [:db_insert_placeholder_2] => 103 [:db_insert_placeholder_3] => 1 ) in flag_flag->_update_count() (line 738 of /var/www/html/milawh/sites/all/modules/flag/flag.inc).

I am trying to use Flags to allow anonymous users to select a location (e.g., county, city, reservation, etc.) which I then use to serve content specific to the users' locations using Views. Anyway, this works perfectly when the flag_contents and flag_counts databases have corresponding entries. However, I notice that after some period of time the flag_contents database will purge itself when I set a new flag. BUT the flag_counts database does not purge itself of the entries that corresponded to the old entries in flag_contents. At this point, if I flag a location that equals one of the unpurged entries in the flag_counts database the error is thrown.

I hope this description makes sense and is at least somewhat illuminating to someone. I'm pretty new to Drupal so I wish I could help more with this bug -- if it is in fact a bug and not just my own failure to understand the solutions as they're described in other posts.

BTW, the Flags module is awesome. Keep up the good work.

Scott Ellis’s picture

Hello Again, I don't know if anyone is looking at my last post (#7) but I have reverted to an older version of my site that appears to be working properly for the time being. I'm going to carefully test every module I update to see if I can determine what may have caused this problem. In any event, please ignore my last post until I have more information. Thanks and sorry for possible false bug report.

Roi Danton’s picture

Title: Error thrown when bookmarking content - Integrity constraint violation views_plugin_query_default.inc » Integrity constraint violation when a flag is set/unset the first time

I have the same problem like #3, #6, #7 when setting a flag when viewing a node. However the error message appears only the first time the node is viewed (once the flag is set/unset the error does not occur again when viewing the node at a later time):

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-6' for key 'PRIMARY': INSERT INTO {flag_counts} (fid, content_type, content_id, count) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => 2 [:db_insert_placeholder_1] => node [:db_insert_placeholder_2] => 6 [:db_insert_placeholder_3] => 1 ) in flag_flag->_update_count() (Zeile 738 von /www/htdocs/xxxx/drupal7/sites/all/modules/flag/flag.inc).
. 
Roi Danton’s picture

Status: Active » Closed (duplicate)

Update to dev version apparently fixes this problem, see also #1088672: Duplicate fid-node key error when flagging content.

blogook’s picture

Edit. nothing to report

zuernbernhard’s picture

Issue summary: View changes

Same Problem here, even with the Dev-Version (7.x-3.6+10-dev)