Use array_key_exists to avoid warning on report GroupBy.tpl template
authorBradley Taylor <hello@brad-taylor.co.uk>
Tue, 27 Sep 2022 18:57:04 +0000 (19:57 +0100)
committerBradley Taylor <hello@brad-taylor.co.uk>
Wed, 28 Sep 2022 20:05:54 +0000 (21:05 +0100)
CRM/Report/Form.php
templates/CRM/Report/Form/Tabs/GroupBy.tpl

index 17814e7fec9970fe08bfb5ae291ef8b3cf097817..b07b082865d3639a06e444811960aabc331b5341 100644 (file)
@@ -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.
index c53b7f579ff1df8decbf758430383103d0d2a898..4e5a7e2d1ef197c0ea6d9a70a4d755eaa475a8f2 100644 (file)
@@ -15,7 +15,7 @@
         {assign var="count" value=`$count+1`}
         <td width="25%">
           {$form.group_bys[$gbElem].html}
-          {if $form.group_bys_freq[$gbElem].html}:<br>
+          {if $form.group_bys_freq && array_key_exists($gbElem, $form.group_bys_freq)}:<br>
             &nbsp;&nbsp;{$form.group_bys_freq[$gbElem].label}&nbsp;{$form.group_bys_freq[$gbElem].html}
           {/if}
         </td>