diff --git a/application/forms/ContactGroupForm.php b/application/forms/ContactGroupForm.php index 42369d9a..575dfba3 100644 --- a/application/forms/ContactGroupForm.php +++ b/application/forms/ContactGroupForm.php @@ -235,7 +235,13 @@ public function editGroup(): bool $toAdd = array_diff($newContacts, $storedContacts); if (! empty($toDelete)) { - $this->db->delete('contactgroup_member', ['contact_id IN (?)' => $toDelete]); + $this->db->delete( + 'contactgroup_member', + [ + 'contactgroup_id = ?' => $this->contactgroupId, + 'contact_id IN (?)' => $toDelete + ] + ); $isUpdated = true; }