MFB: Remove deleted list contacts from the same address book too.
authorJan Schneider <jan@horde.org>
Fri, 9 Apr 2010 13:36:54 +0000 (15:36 +0200)
committerJan Schneider <jan@horde.org>
Fri, 9 Apr 2010 13:37:07 +0000 (15:37 +0200)
turba/docs/CHANGES
turba/lib/Object/Group.php

index 642fce3..4913ba7 100644 (file)
@@ -10,6 +10,7 @@ v3.0-git
 v2.3.4-cvs
 ----------
 
+[jan] Remove deleted contacts from distribution lists in the same address book.
 [mjr] Allow creation of default, personal address book when other read-only
       sources are present.
 [mjr] Log deletion in History  when deleting all of a user's contacts
index 501ed86..4f6dbe7 100644 (file)
@@ -166,6 +166,7 @@ class Turba_Object_Group extends Turba_Object {
                     // Remove the contact if it no longer exists
                     $this->removeMember($member);
                     $modified = true;
+                    continue;
                 }
             } else {
                 list($sourceId, $contactId) = explode(':', $member, 2);
@@ -177,6 +178,9 @@ class Turba_Object_Group extends Turba_Object {
                 if (!is_a($driver, 'PEAR_Error')) {
                     $contact = $driver->getObject($contactId);
                     if (is_a($contact, 'PEAR_Error')) {
+                        // Remove the contact if it no longer exists
+                        $this->removeMember($member);
+                        $modified = true;
                         continue;
                     }
                 } else {