Exclude inactive groups on recipient lists
authorJohn Kingsnorth <john@johnkingsnorth.co.uk>
Mon, 18 Sep 2023 14:55:49 +0000 (15:55 +0100)
committercolemanw <coleman@civicrm.org>
Mon, 18 Sep 2023 19:19:54 +0000 (15:19 -0400)
Civi/Api4/Service/Autocomplete/MailingRecipientsAutocompleteProvider.php

index 6e687e1582856d851b6f79a7390b44fab70a62f3..54fa71f9e64ef82fbdd9f1d4b6b9254f19258b4e 100644 (file)
@@ -70,6 +70,7 @@ class MailingRecipientsAutocompleteProvider extends AutoService implements Event
             ],
             'join' => [],
             'where' => [
+              ['is_active', '=', TRUE],
               ['group_type:name', 'CONTAINS', 'Mailing List'],
               ['OR', [['saved_search_id.expires_date', 'IS NULL'], ['saved_search_id.expires_date', '>', 'NOW()', TRUE]]],
               ['OR', [['is_hidden', '=', FALSE], [($mode === 'include' ? 'mailing_group.id' : '(NULL)'), 'IS NOT NULL']]],