From: Coleman Watts Date: Thu, 6 Mar 2014 16:48:32 +0000 (-0500) Subject: Select2 tweaks X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=609a8c535d5bb5830156a7724d0220341bb7bdd0;p=civicrm-core.git Select2 tweaks --- 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) {