From 2ebb21f0444181c621d33c2202d9cc78b860db41 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 15 Oct 2014 14:29:09 -0400 Subject: [PATCH] CRM-15438 - Fix search component_mode selections --- CRM/Contact/Form/Search.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index 7a0083b2f1..2f422efb05 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -337,7 +337,6 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { */ function buildQuickForm() { parent::buildQuickForm(); - $this->addClass('crm-ajax-selection-form'); CRM_Core_Resources::singleton() // jsTree is needed for tags popup ->addScriptFile('civicrm', 'packages/jquery/plugins/jstree/jquery.jstree.js', 0, 'html-header', FALSE) @@ -459,7 +458,11 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { $this->addTaskMenu($tasks); } - if ($qfKeyParam = CRM_Utils_Array::value('qfKey', $this->_formValues)) { + $selectedContactIds = array(); + $qfKeyParam = CRM_Utils_Array::value('qfKey', $this->_formValues); + // We use ajax to handle selections only if the search results component_mode is set to "contacts" + if ($qfKeyParam && $this->get('component_mode') <= 1) { + $this->addClass('crm-ajax-selection-form'); $qfKeyParam = "civicrm search {$qfKeyParam}"; $selectedContactIdsArr = CRM_Core_BAO_PrevNextCache::getSelection($qfKeyParam); $selectedContactIds = array_keys($selectedContactIdsArr[$qfKeyParam]); -- 2.25.1