Select2 tweaks
authorColeman Watts <coleman@civicrm.org>
Thu, 6 Mar 2014 16:48:32 +0000 (11:48 -0500)
committerColeman Watts <coleman@civicrm.org>
Thu, 6 Mar 2014 16:48:32 +0000 (11:48 -0500)
api/v3/Contact.php
js/Common.js

index 3e0b6a863c9b7b315db777138b23cc5c9982c81f..73e6f64f94fa1a8298997b6e311c0f13761eb545 100644 (file)
@@ -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'];
+  }
 }
 
 /**
index 93448f3eff48da1a0a913be804b5a67d5165229b..9208d5986c91d4dea3c216c93c6f7bfd5aececef 100644 (file)
@@ -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) {