There is another post that I've been following over a year about the issue this module has with creating duplicate profiles under specific circumstances. There has been no remedy to the situation so my question isn't How do we prevent duplicates, but how do we handle them once they're discovered.

I was going to just delete the additional record from the profile table in the database but then I considered that would likely leave orphaned files fields throughout database and affect data integrity. (I'm not sure which of duplicate profiles is being used for other operations on the site involving the use of profile fields)

Comments

Kcannick created an issue. See original summary.

littlepixiez’s picture

I would say this probably isn't a duplicate of #1549224: Prevent duplicate profiles from being added in the db as that appears to be focusing on preventing future problems. I would really like to know the correct way to handle duplicates also.

I have the same issue - one of my users has duplicate profile IDs for one of my profile types (not sure how it happened).

I thought about doing a Views Bulk Operation as you can create a view of profiles and delete items using this - I also don't know if this will deal with orphaned fields though, it might do exactly what it would do if you just deleted the row in the database.

But this is one alternative to delving into tables if people want to risk it!

kcannick’s picture

@Littlepixiez there is a delete profile function in the profile 2 module that I plan on using to delete the duplicate profiles. I just have to take some time to see which profile is actually editable by user as not to delete the profile (and related fields) with the active data. After I figure that out I may just create an action to purge duplicate profiles and schedule to run once a day.

It's not the desired solution but I have a few dozen duplicate accounts and they happen randomly.

rickj’s picture

Status: Active » Closed (duplicate)
Related issues: +#1549224: Prevent duplicate profiles from being added in the db

Closing as duplicate of #1549224: Prevent duplicate profiles from being added in the db, which has been committed. That patch includes code to prevent new duplicates, as well as remove existing ones as a database update.