From 1a9a2abfd0376c002c25e878e3eb997d490aead7 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sun, 5 Jun 2016 17:48:20 +1000 Subject: [PATCH] CRM-18652 fix bug found in testing --- templates/CRM/common/navigation.js.tpl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/CRM/common/navigation.js.tpl b/templates/CRM/common/navigation.js.tpl index ff43fbd7ad..fe89a91009 100644 --- a/templates/CRM/common/navigation.js.tpl +++ b/templates/CRM/common/navigation.js.tpl @@ -119,6 +119,8 @@ $('#civicrm-menu').ready(function() { select: function (event, ui) { if (ui.item.value > 0) { document.location = CRM.url('civicrm/contact/view', {reset: 1, cid: ui.item.value}); + } else { + document.location = CRM.url('civicrm/contact/search/advanced', {reset: 1}); } return false; }, @@ -171,8 +173,10 @@ $('#civicrm-menu').ready(function() { var $menu = $('#sort_name_navigation').autocomplete('widget'); if ($('li.ui-menu-item', $menu).length === 1) { var cid = $('li.ui-menu-item', $menu).data('ui-autocomplete-item').value; - document.location = CRM.url('civicrm/contact/view', {reset: 1, cid: cid}); - return false; + if (cid > 0) { + document.location = CRM.url('civicrm/contact/view', {reset: 1, cid: cid}); + return false; + } } }); // Close menu after selecting an item -- 2.25.1