From 6f7e23df221f965a40a413610ee1042347254dc2 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 14 Jan 2014 21:47:23 -0800 Subject: [PATCH] CRM-14076 - Export - fix label to work as the query object expects --- CRM/Export/BAO/Export.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index e1fbe289bf..4a76a601fb 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -830,6 +830,9 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c foreach (array_keys($val) as $fld) { $type = explode('-', $fld); $fldValue = "{$ltype}-" . $type[0]; + // CRM-14076 - fix label to work as the query object expects + // FIXME: We should not be using labels as keys! + $daoField = CRM_Utils_String::munge($ltype) . '-' . $type[0]; if (CRM_Utils_Array::value(1, $type)) { $fldValue .= "-" . $type[1]; @@ -839,20 +842,20 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c switch ($fld) { case 'country': case 'world_region': - $row[$fldValue] = $i18n->crm_translate($dao->$fldValue, array('context' => 'country')); + $row[$fldValue] = $i18n->crm_translate($dao->$daoField, array('context' => 'country')); break; case 'state_province': - $row[$fldValue] = $i18n->crm_translate($dao->$fldValue, array('context' => 'province')); + $row[$fldValue] = $i18n->crm_translate($dao->$daoField, array('context' => 'province')); break; case 'im_provider': - $imFieldvalue = $fldValue . "-provider_id"; + $imFieldvalue = $daoField . "-provider_id"; $row[$fldValue] = CRM_Utils_Array::value($dao->$imFieldvalue, $imProviders); break; default: - $row[$fldValue] = $dao->$fldValue; + $row[$fldValue] = $dao->$daoField; break; } } -- 2.25.1