From c3bcf6ba489ab1c05bc1e47eed95a7bb97b8f1e7 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 19 Oct 2014 18:00:24 -0400 Subject: [PATCH] CRM-15493 - Ensure quickSearch uses a fresh qfKey every time --- CRM/Core/Smarty/plugins/function.crmNavigationMenu.php | 4 +++- templates/CRM/common/navigation.js.tpl | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Smarty/plugins/function.crmNavigationMenu.php b/CRM/Core/Smarty/plugins/function.crmNavigationMenu.php index 8fcbd47069..e9120445a2 100644 --- a/CRM/Core/Smarty/plugins/function.crmNavigationMenu.php +++ b/CRM/Core/Smarty/plugins/function.crmNavigationMenu.php @@ -63,7 +63,9 @@ function smarty_function_crmNavigationMenu($params, &$smarty) { $domain = CRM_Core_Config::domainID(); $key = CRM_Core_BAO_Navigation::getCacheKey($contactID); $src = CRM_Utils_System::url("civicrm/ajax/menujs/$contactID/$lang/$domain/$key"); - return ''; + // CRM-15493 QFkey needed for quicksearch bar - must be unique on each page refresh so adding it directly to markup + $qfKey = CRM_Core_Key::get('CRM_Contact_Controller_Search', TRUE); + return ''; } } return ''; diff --git a/templates/CRM/common/navigation.js.tpl b/templates/CRM/common/navigation.js.tpl index 05c8c53d0c..ff627c457d 100644 --- a/templates/CRM/common/navigation.js.tpl +++ b/templates/CRM/common/navigation.js.tpl @@ -32,7 +32,7 @@ - +
@@ -80,6 +80,9 @@ $("#crm-nav-menu-container").html(menuMarkup).css({'padding-bottom': '10px'}); } {/literal}{/if}{literal} + // CRM-15493 get the current qfKey + $("input[name=qfKey]", "#quickSearch").val($('#civicrm-navigation-menu').data('qfkey')); + $('#civicrm-menu').ready(function() { $('#root-menu-div .outerbox').css({'margin-top': '6px'}); $('#root-menu-div .menu-ul li').css({'padding-bottom': '2px', 'margin-top': '2px'}); -- 2.25.1