Fix php7.2 notices on trying to count null
authoreileen <emcnaughton@wikimedia.org>
Fri, 16 Nov 2018 01:55:38 +0000 (14:55 +1300)
committereileen <emcnaughton@wikimedia.org>
Fri, 16 Nov 2018 01:55:38 +0000 (14:55 +1300)
templates/CRM/Contribute/Form/Contribution/Confirm.tpl
templates/CRM/Contribute/Form/Contribution/Main.tpl
templates/CRM/Contribute/Form/Contribution/OnBehalfOf.tpl
templates/CRM/Contribute/Form/Contribution/ThankYou.tpl

index 8d580a2ea59590974eacef4e5a2d4afe02826f73..8adea18fd02afd973052b5b2140d723ff75c5b94 100644 (file)
     </div>
     {/if}
 
-    {if $onbehalfProfile|@count}
+    {if $onbehalfProfile && $onbehalfProfile|@count}
       <div class="crm-group onBehalf_display-group label-left crm-profile-view">
          {include file="CRM/UF/Form/Block.tpl" fields=$onbehalfProfile prefix='onbehalf'}
       </div>
     {/if}
 
-    {if $honoreeProfileFields|@count}
+    {if $honoreeProfileFields && $honoreeProfileFields|@count}
         <div class="crm-group honor_block-group">
             <div class="header-dark">
                 {$soft_credit_type}
index 52b102ed8b537b6fb332d3aa0e7051fc5977bcb8..db82a07df4ee8111e0307dedad3bed29f72ca5d4 100644 (file)
       {include file="CRM/Contribute/Form/Contribution/PremiumBlock.tpl" context="makeContribution"}
     </div>
 
-    {if $honoreeProfileFields|@count}
+    {if $honoreeProfileFields && $honoreeProfileFields|@count}
       <fieldset class="crm-public-form-item crm-group honor_block-group">
         {crmRegion name="contribution-soft-credit-block"}
           <legend>{$honor_block_title}</legend>
index 4757a3131e3d9e513337ae09945d32fcb20963f8..983a6a8e77b6541d4870cf72c1faa713363bd34b 100644 (file)
@@ -41,7 +41,7 @@
 
 <div class="crm-public-form-item" id="on-behalf-block">
   {crmRegion name="onbehalf-block"}
-    {if $onBehalfOfFields|@count}
+    {if $onBehalfOfFields && $onBehalfOfFields|@count}
       <fieldset>
       <legend>{$fieldSetTitle}</legend>
       {if $form.org_option}
index 8520b458b5398ca894d23a676fcb8a7ea72c55ee..fcab862e37b29df37fadd2029f3a006522410afe 100644 (file)
     </div>
   {/if}
 
-  {if $onbehalfProfile|@count}
+  {if $onbehalfProfile && $onbehalfProfile|@count}
     <div class="crm-group onBehalf_display-group label-left crm-profile-view">
       {include file="CRM/UF/Form/Block.tpl" fields=$onbehalfProfile prefix='onbehalf'}
      </div>
   {/if}
 
-  {if $honoreeProfileFields|@count}
+  {if $honoreeProfileFields && $honoreeProfileFields|@count}
     <div class="crm-group honor_block-group">
       <div class="header-dark">
         {$soft_credit_type}