Skip to content

Commit

Permalink
Fix phone_type_id in export per test
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Dec 13, 2018
1 parent f797aeb commit d6d225e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CRM/Export/BAO/ExportProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,9 @@ public function getTransformedFieldValue($field, $iterationDAO, $fieldValue, $me
return $i18n->crm_translate($fieldValue, $metadata[$field]);
}
if (!empty($metadata[$field]['pseudoconstant'])) {
if (!empty($metadata[$field]['bao'])) {
return CRM_Core_PseudoConstant::getLabel($metadata[$field]['bao'], $metadata[$field]['name'], $fieldValue);
}
// This is not our normal syntax for pseudoconstants but I am a bit loath to
// call an external function until sure it is not increasing php processing given this
// may be iterated 100,000 times & we already have the $imProvider var loaded.
Expand Down Expand Up @@ -1147,7 +1150,7 @@ public function getMungedFieldName($field) {
* @return string
*/
protected function getOutputSpecificationIndex($key, $relationshipType, $locationType, $entityLabel) {
if ($locationType || $entityLabel || $key === 'im') {
if ($entityLabel || $key === 'im') {
// Just cos that's the history...
if ($key !== 'master_id') {
$key = $this->getHeaderForRow($key);
Expand Down Expand Up @@ -1200,8 +1203,9 @@ protected function getOutputSpecificationLabel($key, $relationshipType, $locatio
* @return string
*/
protected function getOutputSpecificationFieldKey($key, $relationshipType, $locationType, $entityLabel) {
if ($relationshipType || $entityLabel || $key === 'im') {
if ($entityLabel || $key === 'im') {
if ($key !== 'state_province' && $key !== 'id') {
// @todo - test removing this - indexing by $key should be fine...
$key = $this->getHeaderForRow($key);
}
}
Expand Down

0 comments on commit d6d225e

Please sign in to comment.