I get the following warning when I save the user profile edit form without making any form changes to comment notify settings. (Such as enabling notifications or switching from all comments to only replies). If I make changes to comment notify form settings then the error does not appear upon saving the form.

user warning: Duplicate entry '3' for key 'PRIMARY' query: INSERT INTO comment_notify_user_settings (uid, node_notify, comment_notify) VALUES (3, 1, 1) in C:\websites\dev_site\sites\all\modules\comment_notify\comment_notify.module on line 328.

Files: 

Comments

are you using a mysql backend?
seems like the db_affected_rows() isnt affected by the UPDATE call, mysql and pgsql should return a valid value
i think its harmless if thats the case.. youll just get watchdog spam

Yes I'm using MYSQL.

Title:User Warning on user profile edit formDuplicate entry warning on saving user edit form

Definitely seems like something we should fix.

The alternate pattern is to do a select and then an update if rows are returned or an insert if not. That's not as awesome for performance, though.

subscribe
Same Problem /6.17


user warning: Duplicate entry '2759' for key 1 query: INSERT INTO comment_notify_user_settings (uid, node_notify, comment_notify) VALUES (2759, 0, 0) in xxxx/modules/comment_notify/comment_notify.module on line 328

I think this is caused by #805858: Affected rows inconsistent across database engines. So, I guess the solution is to just hide this error using the @ in php.

Yep, also seeing the same problem. I take it that there are no nasty side-effects to this, such as users receiving replies to comments which they didn't post etc?

Correct, this is cosmetic and not a functional problem.

Title:Duplicate entry warning on saving user edit formSuppress duplicate entry warning on saving user edit form
Status:Active» Fixed
StatusFileSize
new1.32 KB

Here's a patch I just committed to 6.x - http://drupal.org/cvs?commit=434346

Thanks for your patience, folks.

Status:Fixed» Closed (fixed)

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