From a3f6a93a6d00320f6209b4e78aa8af5fa1d9d833 Mon Sep 17 00:00:00 2001 From: Bradley Taylor Date: Tue, 27 Sep 2022 19:57:04 +0100 Subject: [PATCH] Use array_key_exists to avoid warning on report GroupBy.tpl template --- CRM/Report/Form.php | 2 +- templates/CRM/Report/Form/Tabs/GroupBy.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 17814e7fec..b07b082865 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -21,7 +21,7 @@ class CRM_Report_Form extends CRM_Core_Form { * * @var string[] */ - public $expectedSmartyVariables = ['pager', 'skip', 'sections', 'grandStat', 'chartEnabled', 'uniqueId', 'rows']; + public $expectedSmartyVariables = ['pager', 'skip', 'sections', 'grandStat', 'chartEnabled', 'uniqueId', 'rows', 'group_bys_freq']; /** * Deprecated constant, Reports should be updated to use the getRowCount function. diff --git a/templates/CRM/Report/Form/Tabs/GroupBy.tpl b/templates/CRM/Report/Form/Tabs/GroupBy.tpl index c53b7f579f..4e5a7e2d1e 100644 --- a/templates/CRM/Report/Form/Tabs/GroupBy.tpl +++ b/templates/CRM/Report/Form/Tabs/GroupBy.tpl @@ -15,7 +15,7 @@ {assign var="count" value=`$count+1`} {$form.group_bys[$gbElem].html} - {if $form.group_bys_freq[$gbElem].html}:
+ {if $form.group_bys_freq && array_key_exists($gbElem, $form.group_bys_freq)}:
  {$form.group_bys_freq[$gbElem].label} {$form.group_bys_freq[$gbElem].html} {/if} -- 2.25.1