Fix undefined tpl variables
authorColeman Watts <coleman@civicrm.org>
Thu, 8 Jul 2021 20:34:47 +0000 (16:34 -0400)
committerColeman Watts <coleman@civicrm.org>
Thu, 8 Jul 2021 20:34:47 +0000 (16:34 -0400)
templates/CRM/Admin/Form/Setting/Debugging.tpl
templates/CRM/Contact/Form/Task.tpl
templates/CRM/Contact/Form/Task/EmailCommon.tpl
templates/CRM/Form/attachment.tpl

index 5c785c8c8b8fc130336eb99b1a1996d9f5b352b3..84559cd5976892229b4bed37396a6d99cff73016 100644 (file)
     {ts}In addition to the settings on this screen, there are a number of settings you can add to your sites's settings file (civicrm.settings.php) to provide additional debugging information.{/ts} {docURL page="dev/tools/debugging/#changing-file-based-settings"}
 </div>
 <div class="crm-block crm-form-block crm-debugging-form-block">
-<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
-         <table class="form-layout">
-            {if $form.userFrameworkLogging}
+    <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
+    <table class="form-layout">
+        {if !empty($form.userFrameworkLogging)}
             <tr class="crm-debugging-form-block-userFrameworkLogging">
                 <td class="label">{$form.userFrameworkLogging.label}</td>
                 <td>{$form.userFrameworkLogging.html}<br />
                 <span class="description">{ts}Set this value to <strong>Yes</strong> if you want CiviCRM error/debugging messages to appear in the Drupal error logs{/ts} {help id='userFrameworkLogging'}</span></td>
             </tr>
-            {/if}
+        {/if}
             <tr class="crm-debugging-form-block-debug">
                 <td class="label">{$form.debug_enabled.label}</td>
                 <td>{$form.debug_enabled.html}<br />
@@ -45,7 +45,7 @@
                 <td>{$form.assetCache.html}<br />
                 <span class="description">{ts}Store computed JS/CSS content in cache files? (Note: In "Auto" mode, the "Debug" setting will determine whether to activate the cache.){/ts}</span></td>
             </tr>
-        </table>
-        <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
-<div class="spacer"></div>
+    </table>
+    <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
+    <div class="spacer"></div>
 </div>
index b1f065d9a7f9ac5fa64598cbf1e8770dc05c0acb..63b55a5170ce8babdc84c0a4f383495dc15576db 100644 (file)
@@ -9,7 +9,7 @@
 *}
 {ts 1=$totalSelectedContacts}Number of selected contacts: %1{/ts}
 
-{if $searchtype eq 'ts_sel'}
+{if !empty($searchtype) && $searchtype eq 'ts_sel'}
 <div id="popupContainer">
   <div class="crm-block crm-form-block crm-search-form-block">
     <table id="selectedRecords-{$group.id}" class="display crm-copy-fields crm-sortable">
@@ -32,7 +32,7 @@
 <a href="#" id="popup-button" title="{ts}View Selected Contacts{/ts}">{ts}View Selected Contacts{/ts}</a>
 {/if}
 
-{if $searchtype eq 'ts_sel'}
+{if !empty($searchtype) && $searchtype eq 'ts_sel'}
 {literal}
 <script type="text/javascript">
   CRM.$(function($) {
@@ -73,7 +73,7 @@
 {/literal}
 {/if}
 
-{if $rows}
+{if !empty($rows)}
 <div class="form-item">
   <table width="30%">
     <tr class="columnheader">
index 3e54f294706a28dad147254070bc93fa772c3210..6c0f69516e8944a17b3bff3ffa81c8c474f2a75d 100644 (file)
@@ -59,7 +59,7 @@
    <div class="content">{$form.saveTemplateName.html|crmAddClass:huge}</div>
 </div>
 
-{if ! $noAttach}
+{if empty($noAttach)}
     {include file="CRM/Form/attachment.tpl"}
 {/if}
 
index 687751331dbc34df5567909118efab6c6e3ad390..d34f68ac2560a54356989c07c6dbcb87736b9368 100644 (file)
         </td>
     </tr>
 {elseif $action NEQ 4}
-    {if $context EQ 'pcpCampaign'}
+    {if !empty($context) && $context EQ 'pcpCampaign'}
       {capture assign=attachTitle}{ts}Include a Picture or an Image{/ts}{/capture}
     {else}
       {capture assign=attachTitle}{ts}Attachment(s){/ts}{/capture}
     {/if}
-    {if !$noexpand}
-    <div class="crm-accordion-wrapper {if $context NEQ 'pcpCampaign' AND !$currentAttachmentInfo}collapsed{/if}">
+    {if empty($noexpand)}
+    <div class="crm-accordion-wrapper {if (empty($context) || $context NEQ 'pcpCampaign') AND empty($currentAttachmentInfo)}collapsed{/if}">
        <div class="crm-accordion-header">
           {$attachTitle}
       </div><!-- /.crm-accordion-header -->
@@ -42,7 +42,7 @@
     <div id="attachments">
       <table class="form-layout-compressed">
       {if $form.attachFile_1}
-        {if $context EQ 'pcpCampaign'}
+        {if !empty($context) && $context EQ 'pcpCampaign'}
             <div class="description">{ts}You can upload a picture or image to include on your page. Your file should be in .jpg, .gif, or .png format. Recommended image size is 250 x 250 pixels. Images over 360 pixels wide will be automatically resized to fit.{/ts}</div>
         {/if}
         <tr>