Fix quicksearch by id CRM-12475
authorColeman Watts <coleman@civicrm.org>
Thu, 16 May 2013 14:35:10 +0000 (09:35 -0500)
committerColeman Watts <coleman@civicrm.org>
Thu, 16 May 2013 14:35:10 +0000 (09:35 -0500)
api/v3/Contact.php

index cb603cb60175f3e19d4fc62ef80aa63900c447d8..b42f968bde4a1861db7188563b097cf7d1b8e0ed 100644 (file)
@@ -560,6 +560,10 @@ function civicrm_api3_contact_getquick($params) {
   }
   // If we are doing quicksearch by a field other than name, make sure that field is added to results
   if (!empty($params['field_name'])) {
+    // Unique name contact_id = id
+    if ($params['field_name'] == 'contact_id') {
+      $params['field_name'] = 'id';
+    }
     // phone_numeric should be phone
     $searchField = str_replace('_numeric', '', $params['field_name']);
     if(!in_array($searchField, $list)) {