From 609a8c535d5bb5830156a7724d0220341bb7bdd0 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 6 Mar 2014 11:48:32 -0500 Subject: [PATCH] Select2 tweaks --- api/v3/Contact.php | 4 +++- js/Common.js | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/api/v3/Contact.php b/api/v3/Contact.php index 3e0b6a863c..73e6f64f94 100644 --- a/api/v3/Contact.php +++ b/api/v3/Contact.php @@ -928,7 +928,9 @@ function _civicrm_api3_contact_getlist_params(&$request) { $request['params']['return'] = array_unique(array_merge($list, $request['extra'])); $request['params']['options']['sort'] = 'sort_name'; // Contact api doesn't support array(LIKE => 'foo') syntax - $request['params'][$request['search_field']] = $request['input']; + if (!empty($request['input'])) { + $request['params'][$request['search_field']] = $request['input']; + } } /** diff --git a/js/Common.js b/js/Common.js index 93448f3eff..9208d5986c 100644 --- a/js/Common.js +++ b/js/Common.js @@ -275,8 +275,7 @@ CRM.validate = CRM.validate || { }; /** - * Select2 api leaves something to be desired. To alter options on-the-fly often requires re-rendering the whole thing. - * So making this function public in case anyone needs it. + * Wrapper around select2 initialization function; supplies defaults * @param options object */ $.fn.crmSelect2 = function(options) { -- 2.25.1