Menu

#5 Relationship plugin - crash when deleting a contact

Unstable (example)
closed
None
5
2021-12-24
2009-02-11
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

  • Jonathan Daley

    Jonathan Daley - 2021-12-24
    • status: open --> closed
    • assigned_to: Jonathan Daley
    • Group: --> Unstable (example)
     
  • Jonathan Daley

    Jonathan Daley - 2021-12-24

    applied in rev 673

     

Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.
Try Free →