From: Eileen McNaughton Date: Sat, 6 Nov 2021 00:07:49 +0000 (+1300) Subject: Ensure that keys are set in tabValues before hitting smarty X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f5f479b9d07cd61bafb0731187f63069b0ae5c0e;p=civicrm-core.git Ensure that keys are set in tabValues before hitting smarty --- diff --git a/CRM/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php index 1cfd39f9db..d05569362e 100644 --- a/CRM/Contact/Page/View/Summary.php +++ b/CRM/Contact/Page/View/Summary.php @@ -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; } diff --git a/templates/CRM/Contact/Page/View/Summary.tpl b/templates/CRM/Contact/Page/View/Summary.tpl index 992ef9e2db..a05e5ea23b 100644 --- a/templates/CRM/Contact/Page/View/Summary.tpl +++ b/templates/CRM/Contact/Page/View/Summary.tpl @@ -110,11 +110,11 @@