CRM-13024 fixes
authormonishdeb <monish.deb@webaccess.co.in>
Tue, 16 Jul 2013 10:11:53 +0000 (15:41 +0530)
committermonishdeb <monish.deb@webaccess.co.in>
Tue, 16 Jul 2013 10:11:53 +0000 (15:41 +0530)
----------------------------------------
* CRM-13024: Search Builder dropdowns broken for Groups, State, Country ...
  http://issues.civicrm.org/jira/browse/CRM-13024

CRM/Contact/Form/Search/Builder.php
api/v3/utils.php

index 950c1613960e1169aff5875d41ec99c4d124317e..5690430d27cd55ad917475748cf052fdbc1cba5b 100644 (file)
@@ -407,10 +407,10 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search {
     // Hack to add options not retrieved by getfields
     // This list could go on and on, but it would be better to fix getfields
     $options = array(
-      'group' => 'contact',
-      'tag' => 'contact',
-      'country' => 'contact',
-      'state_province' => 'contact',
+      'group' => 'group_contact',
+      'tag' => 'entity_tag',
+      'country' => 'address',
+      'state_province' => 'address',
       'gender' => 'contact',
       'world_region' => 'contact',
       'individual_prefix' => 'contact',
index cd67feb0b886332a3b162dc8bcc0c41b025e607e..b29b0713a816aeafdccd8287d4a20d9e030ad13e 100644 (file)
@@ -1633,6 +1633,9 @@ function _civicrm_api3_api_resolve_alias($entity, $fieldName) {
     'action' => 'create',
   ));
   $meta = $result['values'];
+  if (!isset($meta[$fieldName]['name']) && isset($meta[$fieldName . '_id'])) {
+    $fieldName = $fieldName . '_id';
+  }
   if (isset($meta[$fieldName])) {
     return $meta[$fieldName]['name'];
   }