Remove unnecessary count() from smarty conditionals
authorColeman Watts <coleman@civicrm.org>
Mon, 17 Apr 2023 17:22:54 +0000 (13:22 -0400)
committerColeman Watts <coleman@civicrm.org>
Mon, 17 Apr 2023 17:22:54 +0000 (13:22 -0400)
templates/CRM/Form/body.tpl
templates/CRM/common/SectionNav.tpl
templates/CRM/common/displaySearchCriteria.tpl

index 20b8b576297ab0b5f410c6d3c2cf3aff52aa4c9d..bdcacf42069058b206e9375718aeebe451cf67c6 100644 (file)
@@ -15,7 +15,7 @@
   <div>{$form.hidden}</div>
 {/if}
 
-{if ($snippet !== 'json') and !$suppressForm and $form.errors !== NULL && count($form.errors) gt 0}
+{if ($snippet !== 'json') and !$suppressForm and $form.errors}
    <div class="messages crm-error">
        <i class="crm-i fa-exclamation-triangle crm-i-red" aria-hidden="true"></i>
      {ts}Please correct the following errors in the form fields below:{/ts}
index e99fd0630f870cfc85fb084c2d3dc9d835733cd4..11eb81152d9564c380476cfc1c7570bc96ce5037 100644 (file)
@@ -8,7 +8,7 @@
  +--------------------------------------------------------------------+
 *}
 {* Navigation template for multi-section Wizards *}
-{if count( $category.steps ) > 0}
+{if $category.steps}
 <div id="wizard-steps">
    <ul class="section-list">
     {foreach from=$category.steps item=step}
index f6e587e47fd9e1e34252d8383427b1f44374f486..5ed276dc0fae3f02a67972ebbce9ef1b06fb3249 100644 (file)
@@ -11,7 +11,7 @@
 {foreach from=$qill name=sets key=setKey item=orClauses}
     {if $smarty.foreach.sets.total > 2}
         {* We have multiple criteria sets, so display AND'd items in each set on the same line. *}
-        {if count($orClauses) gt 0}
+        {if $orClauses}
         <ul>
         <li>
         {foreach from=$orClauses name=criteria item=item}