PPL

Merge Contacts does not remove duplicate portraits

Bug #719084 reported by Christopher Adams
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PPL
Fix Released
Critical
Christopher Adams

Bug Description

To reproduce this bug:

Step 1: Import all your contacts and sync Flickr stream and Find Portraits.

Use case: You have at least one contact with a portrait who needs to be merged.

Result: You have at least two contacts with the same name. Each one has a copy of the portrait.

Step 2: Merge Contacts

What should happen: The contact who is merged and deleted; his copies of the portraits should be removed.

What actually seems to happen: all portraits are merged into the merged user.

Result: User has multiple copies of portraits.

Revision history for this message
Christopher Adams (christopheradams) wrote :

This is complicated by the following possibility:

I have 2 contacts: Jon Phillips and Jonathan Phillips

I have 2 photos on Flickr with titles: Jon Phillips and Jonathan Phillips

I import all contacts and photos.

I edit Jonathan Phillips » Jon Phillips

I merge contacts.

Jon Phillips should now have the 2 photos.

Changed in ppl:
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → Bassel Safadi (bassel)
milestone: none → 0.2
Revision history for this message
Christopher Adams (christopheradams) wrote :

The goal that will fix all this is the rule:

You cannot have multiple records in ppl_portraits with same flickr_id AND subject_id

rejon (rejon)
Changed in ppl:
milestone: 0.2 → 0.3
Revision history for this message
Christopher Adams (christopheradams) wrote : Re: [Bug 719084] Re: Merge Contacts does not remove duplicate portraits

Wait, this didn't get fixed yet? This is a major bug in 0.2.

On Wed, Feb 16, 2011 at 12:02 AM, rejon <email address hidden> wrote:

> ** Changed in: ppl
> Milestone: 0.2 => 0.3
>
> --
> You received this bug notification because you are a member of PPL
> Developers, which is subscribed to PPL.
> https://bugs.launchpad.net/bugs/719084
>
> Title:
> Merge Contacts does not remove duplicate portraits
>
> Status in PPL:
> Confirmed
>
> Bug description:
> To reproduce this bug:
>
> Step 1: Import all your contacts and sync Flickr stream and Find
> Portraits.
>
> Use case: You have at least one contact with a portrait who needs to
> be merged.
>
> Result: You have at least two contacts with the same name. Each one
> has a copy of the portrait.
>
> Step 2: Merge Contacts
>
> What should happen: The contact who is merged and deleted; his copies
> of the portraits should be removed.
>
> What actually seems to happen: all portraits are merged into the
> merged user.
>
> Result: User has multiple copies of portraits.
>
>
>

Revision history for this message
Bassel Safadi (bassel) wrote :

ok will fix today

Revision history for this message
Christopher Adams (christopheradams) wrote :

Just thinking quickly here the following algorithm should solve it:

1) Get a list of photo_ids of the $TARGET_ID

SELECT photo_id FROM ppl_portraits WHERE subject_id = '$TARGET_ID'

Implode that into a list where $portrait_list = [1, 2, 3, 4]

2) Update the subject_id of the portraits for the $SOURCE_ID which are not in that list

update ppl_portraits set subject_id = '$TARGET_ID' where subject_id = '$SOURCE_ID' and photo_id not in ($portrait_list)

3) Delete all portraits of the $SOURCE_ID

delete from ppl_portraits where subject_id = '$SOURCE_ID'

Changed in ppl:
assignee: Bassel Safadi (bassel) → Christopher Adams (christopheradams)
status: Confirmed → In Progress
Changed in ppl:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.