if ($this->_action == CRM_Core_Action::DELETE) {
if (isset($this->_id)) {
$this->assign('title', $this->_title);
- try {
- $this->assign('count', CRM_Contact_BAO_Group::memberCount($this->_id));
- }
- catch (CRM_Core_Exception $e) {
- // If the group is borked the query might fail but delete should be possible.
+ if (!($this->_groupValues['saved_search_id'])) {
+ try {
+ $count = CRM_Contact_BAO_Group::memberCount($this->_id);
+ }
+ catch (CRM_Core_Exception $e) {
+ // If the group is borked the query might fail but delete should be possible.
+ }
}
+ $this->assign('count', $count ?? NULL);
$this->setTitle(ts('Confirm Group Delete'));
}
if ($this->_groupValues['is_reserved'] == 1 && !CRM_Core_Permission::check('administer reserved groups')) {
<div class="messages status no-popup">
<img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/>
{ts 1=$title}Are you sure you want to delete the group %1?{/ts}<br /><br />
- {if $count}
+ {if $count !== NULL}
{ts count=$count plural='This group currently has %count members in it.'}This group currently has one member in it.{/ts}
{/if}
{ts}Deleting this group will NOT delete the member contact records. However, all contact subscription information and history for this group will be deleted.{/ts} {ts}If this group is used in CiviCRM profiles, those fields will be reset.{/ts} {ts}This action cannot be undone.{/ts}