Had a problem with ocassionally throwing error for flagging content of duplicate issue for anonymous user, so used the patch from here (http://drupal.org/node/1088672) and problem resolved.

Now new problem appear, that might have been there before but i just noticed today. When anonymous user flag content and do the comparison and content stay flagged, then if anonymous user wants to login (www.carnity.org, user:john, pw:123456) it shows similar type of PDO error but in flag.module instead of flag.inc (which got fixed after patch). Can you please help resolving this bug???? Thanks in advance.

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-7-1-0' for key 'fid_content_id_uid_sid': UPDATE {flag_content} SET uid=:db_update_placeholder_0, sid=:db_update_placeholder_1 WHERE (uid = :db_condition_placeholder_0) AND (sid = :db_condition_placeholder_1) ; Array ( [:db_update_placeholder_0] => 1 [:db_update_placeholder_1] => 0 [:db_condition_placeholder_0] => 0 [:db_condition_placeholder_1] => 20 ) in flag_user_login() (line 573 of /home/thehighb/public_html/carnity.org/sites/all/modules/flag/flag.module).

Comments

calefilm’s picture

Same issue. Worried that you didn't find solution to resolve errors.

Here's my error:

PDOException: SQLSTATE[HY000]: General error: 1093 You can't specify target table 'flag_content' for update in FROM clause: UPDATE {flag_content} SET uid=:db_update_placeholder_0, sid=:db_update_placeholder_1 WHERE (uid = :db_condition_placeholder_0) AND (sid = :db_condition_placeholder_1) AND ( NOT EXISTS (SELECT fc.* FROM {flag_content} fc WHERE (uid = :db_condition_placeholder_2) AND (sid = :db_condition_placeholder_3) AND (fc.fid=flag_content.fid AND fc.content_id=flag_content.content_id) )) ; Array ( [:db_update_placeholder_0] => 4 [:db_update_placeholder_1] => 0 [:db_condition_placeholder_0] => 0 [:db_condition_placeholder_1] => 1 [:db_condition_placeholder_2] => 4 [:db_condition_placeholder_3] => 0 ) in flag_user_login() (line 578 of /Users/cale/Sites/acquia-drupal/sites/all/modules/flag/flag.module).