Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#5 Relationship plugin - crash when deleting a contact

open
nobody
None
5
2009-02-11
2009-02-11
Jonathan Daley
No

The problem is that when a contact is erased, the relationships that are initiated from this contact are deleted properly, but relationships that are initiated from another person are not. Simple fix included below.

Index: Relationships.plugin.php

--- Relationships.plugin.php (revision 7837)
+++ Relationships.plugin.php (working copy)
@@ -258,6 +258,7 @@
// delete all relationships owned by this contact
$id = $contact->contact['id'];
$db->query("DELETE FROM `{$CONFIG_DB_PREFIX}Relationships` WHERE ownerId=$id");
+ $db->query("DELETE FROM `{$CONFIG_DB_PREFIX}Relationships` WHERE relatedToId=$id");

return;
}

Discussion