From 314bcdfdd002febb789f2b50ce20bbb0df3b4072 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 17 Apr 2023 13:22:54 -0400 Subject: [PATCH] Remove unnecessary count() from smarty conditionals --- templates/CRM/Form/body.tpl | 2 +- templates/CRM/common/SectionNav.tpl | 2 +- templates/CRM/common/displaySearchCriteria.tpl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/CRM/Form/body.tpl b/templates/CRM/Form/body.tpl index 20b8b576297a..bdcacf420690 100644 --- a/templates/CRM/Form/body.tpl +++ b/templates/CRM/Form/body.tpl @@ -15,7 +15,7 @@
{$form.hidden}
{/if} -{if ($snippet !== 'json') and !$suppressForm and $form.errors !== NULL && count($form.errors) gt 0} +{if ($snippet !== 'json') and !$suppressForm and $form.errors}
{ts}Please correct the following errors in the form fields below:{/ts} diff --git a/templates/CRM/common/SectionNav.tpl b/templates/CRM/common/SectionNav.tpl index e99fd0630f87..11eb81152d95 100644 --- a/templates/CRM/common/SectionNav.tpl +++ b/templates/CRM/common/SectionNav.tpl @@ -8,7 +8,7 @@ +--------------------------------------------------------------------+ *} {* Navigation template for multi-section Wizards *} -{if count( $category.steps ) > 0} +{if $category.steps}
    {foreach from=$category.steps item=step} diff --git a/templates/CRM/common/displaySearchCriteria.tpl b/templates/CRM/common/displaySearchCriteria.tpl index f6e587e47fd9..5ed276dc0fae 100644 --- a/templates/CRM/common/displaySearchCriteria.tpl +++ b/templates/CRM/common/displaySearchCriteria.tpl @@ -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}
    • {foreach from=$orClauses name=criteria item=item}