From: Eileen McNaughton Date: Tue, 18 Feb 2014 23:32:40 +0000 (+1300) Subject: CRM-14196 - states missing from export fuzion fix - not sure what final fix will be X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7f84f734e6b57bc6e0e1e66f23702397464e4e78;p=civicrm-core.git CRM-14196 - states missing from export fuzion fix - not sure what final fix will be --- diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index df337ec92e..3b6a00d7f8 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -715,16 +715,20 @@ class CRM_Contact_BAO_Query { // also get the id of the tableName $tName = substr($tableName, 8); if (in_array($tName, array('country', 'state_province', 'county'))) { - $pf = ($tName == 'state_province') ? 'state_province_name' : $name; - $this->_pseudoConstantsSelect[$pf] = - array('pseudoField' => "{$tName}_id", 'idCol' => "{$tName}_id", 'bao' => 'CRM_Core_BAO_Address', - 'table' => "civicrm_{$tName}", 'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id "); - if ($tName == 'state_province') { + $this->_pseudoConstantsSelect['state_province_name'] = + array('pseudoField' => "{$tName}", 'idCol' => "{$tName}_id", 'bao' => 'CRM_Core_BAO_Address', + 'table' => "civicrm_{$tName}", 'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id "); + $this->_pseudoConstantsSelect[$tName] = array('pseudoField' => 'state_province_abbreviation', 'idCol' => "{$tName}_id", 'table' => "civicrm_{$tName}", 'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id "); } + else { + $this->_pseudoConstantsSelect[$name] = + array('pseudoField' => "{$tName}_id", 'idCol' => "{$tName}_id", 'bao' => 'CRM_Core_BAO_Address', + 'table' => "civicrm_{$tName}", 'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id "); + } $this->_select["{$tName}_id"] = "civicrm_address.{$tName}_id as {$tName}_id"; $this->_element["{$tName}_id"] = 1;