From f13a16f6b7caa8fb79157b4ff8352c4eff9e669d Mon Sep 17 00:00:00 2001 From: Bradley Taylor Date: Sat, 5 Feb 2022 13:25:54 +0000 Subject: [PATCH] Don't throw PHP notice when rendering dedupefind template. --- CRM/Contact/Form/DedupeFind.php | 8 +++++--- templates/CRM/Contact/Form/DedupeFind.tpl | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CRM/Contact/Form/DedupeFind.php b/CRM/Contact/Form/DedupeFind.php index 13e2a4035f..04a5351161 100644 --- a/CRM/Contact/Form/DedupeFind.php +++ b/CRM/Contact/Form/DedupeFind.php @@ -41,9 +41,11 @@ class CRM_Contact_Form_DedupeFind extends CRM_Admin_Form { $groupList = ['' => ts('- All Contacts -')] + CRM_Core_PseudoConstant::nestedGroup(); $this->add('select', 'group_id', ts('Select Group'), $groupList, FALSE, ['class' => 'crm-select2 huge']); - if (Civi::settings()->get('dedupe_default_limit')) { - $this->add('text', 'limit', ts('No of contacts to find matches for ')); - } + $this->add('text', 'limit', ts('No of contacts to find matches for ')); + + // To improve usability for smaller sites, we don't show the limit field unless a default limit has been set. + $this->assign('limitShown', (bool) Civi::settings()->get('dedupe_default_limit')); + $this->addButtons([ [ 'type' => 'next', diff --git a/templates/CRM/Contact/Form/DedupeFind.tpl b/templates/CRM/Contact/Form/DedupeFind.tpl index d96ba76511..5cb53d59af 100644 --- a/templates/CRM/Contact/Form/DedupeFind.tpl +++ b/templates/CRM/Contact/Form/DedupeFind.tpl @@ -20,10 +20,12 @@ {$form.group_id.label} {$form.group_id.html} - - {$form.limit.label} - {$form.limit.html} - + {if $limitShown} + + {$form.limit.label} + {$form.limit.html} + + {/if}
{include file="CRM/common/formButtons.tpl" location="bottom"}
-- 2.25.1