When more than one field is set to private there are errors on submit.

user warning: Duplicate entry '1' for key 1 query: INSERT INTO profile_privacy_values (fid, uid, private) VALUES (2, 1, 1) in /home/bjeavons/dev/contributions/modules/profile_privacy/profile_privacy.module on line 202.

Instead of two separate unique keys for the table profile_privacy_values this patch makes it a combined key off fid and uid.

Comments

quicksketch’s picture

I think we just need to make the uid and fid normal keys instead of "unique keys". Wouldn't that solve the problem? If we want to add a new key, we should write an update function for people upgrading their existing 5.x installations.

quicksketch’s picture

Status: Needs review » Needs work
coltrane’s picture

Status: Needs work » Needs review
StatusFileSize
new588 bytes

What do you prefer? Here's a patch that does it with just keys. Either patch works but this matches how it was done in 5, you're right.

quicksketch’s picture

Status: Needs review » Fixed

Thanks, I was just wondering why the keys had been changed. I applied this second patch because it fixes the problem and keeps our database schema consistent across versions of Drupal. If adding additional keys for efficiency, we can provide an upgrade path in a separate patch. I'll release a 1.1.1 version to get out a release that works properly. Thanks for your help!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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