Ensure hookContentPlacement is assigned
authorEileen McNaughton <emcnaughton@wikimedia.org>
Sun, 7 Nov 2021 22:34:14 +0000 (11:34 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Sun, 7 Nov 2021 22:34:30 +0000 (11:34 +1300)
CRM/Core/Page.php
templates/CRM/Contact/Page/View/Summary-tab.tpl

index 08b614e651f67a316f5b0c89b9bb202709456436..46ced4b0bd7054891860f0192d06ce96d323813d 100644 (file)
@@ -105,7 +105,7 @@ class CRM_Core_Page {
    *
    * @var string[]
    */
-  public $expectedSmartyVariables = ['breadcrumb', 'pageTitle', 'isForm', 'hookContent'];
+  public $expectedSmartyVariables = ['breadcrumb', 'pageTitle', 'isForm', 'hookContent', 'hookContentPlacement'];
 
   /**
    * Class constructor.
index 67cf851f3eb7546cb228f43e8e0f78624c7c009b..60af440b0acb608ea5145e3258278d8de88fcd20 100644 (file)
@@ -9,9 +9,9 @@
 *}
 {* Summary tab from Contact Summary screen *}
 
-{if (isset($hookContentPlacement) and ($hookContentPlacement neq 3)) or empty($hookContentPlacement)}
+{if $hookContentPlacement !== 3}
 
-  {if !empty($hookContent) and isset($hookContentPlacement) and $hookContentPlacement eq 2}
+  {if $hookContent && $hookContentPlacement eq 2}
     {include file="CRM/Contact/Page/View/SummaryHook.tpl"}
   {/if}
 
     </div>
   {/if}
 
-  {if !empty($hookContent) and isset($hookContentPlacement) and $hookContentPlacement eq 1}
+  {if $hookContent && $hookContentPlacement eq 1}
     {include file="CRM/Contact/Page/View/SummaryHook.tpl"}
   {/if}
 {else}