Skip to content
Snippets Groups Projects
Unverified Commit f982eb14 authored by Seamus Lee's avatar Seamus Lee Committed by GitHub
Browse files

Merge pull request #21991 from eileenmcnaughton/isset4

Ensure that keys are set in tabValues before hitting smarty
parents 7c18a534 f5f479b9
Branches
Tags
No related merge requests found
......@@ -444,6 +444,14 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View {
// now sort the tabs based on weight
usort($allTabs, ['CRM_Utils_Sort', 'cmpFunc']);
$expectedKeys = ['count', 'class', 'template', 'hideCount', 'icon'];
foreach ($allTabs as $index => $tab) {
foreach ($expectedKeys as $key) {
if (!array_key_exists($key, $tab)) {
$allTabs[$index][$key] = NULL;
}
}
}
return $allTabs;
}
......
......@@ -110,11 +110,11 @@
<div id="mainTabContainer">
<ul class="crm-contact-tabs-list">
{foreach from=$allTabs item=tabValue}
<li id="tab_{$tabValue.id}" class="crm-tab-button ui-corner-all{if isset($tabValue.count)} crm-count-{$tabValue.count}{/if}{if isset($tabValue.class)} {$tabValue.class}{/if}">
<a href="{if !empty($tabValue.template)}#contact-{$tabValue.id}{else}{$tabValue.url}{/if}" title="{$tabValue.title|escape}">
<li id="tab_{$tabValue.id}" class="crm-tab-button ui-corner-all{if is_numeric($tabValue.count)} crm-count-{$tabValue.count}{/if}{if $tabValue.class} {$tabValue.class}{/if}">
<a href="{if $tabValue.template}#contact-{$tabValue.id}{else}{$tabValue.url}{/if}" title="{$tabValue.title|escape}">
<i class="{if !empty($tabValue.icon)}{$tabValue.icon}{else}crm-i fa-puzzle-piece{/if}" aria-hidden="true"></i>
<span>{$tabValue.title}</span>
{if empty($tabValue.hideCount)}<em>{if isset($tabValue.count)}{$tabValue.count}{/if}</em>{/if}
{if empty($tabValue.hideCount)}<em>{if is_numeric($tabValue.count)}{$tabValue.count}{/if}</em>{/if}
</a>
</li>
{/foreach}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment