Skip to content
Snippets Groups Projects
Commit 6f7e23df authored by colemanw's avatar colemanw
Browse files

CRM-14076 - Export - fix label to work as the query object expects

parent 7c8759b8
No related branches found
No related tags found
No related merge requests found
...@@ -830,6 +830,9 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c ...@@ -830,6 +830,9 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c
foreach (array_keys($val) as $fld) { foreach (array_keys($val) as $fld) {
$type = explode('-', $fld); $type = explode('-', $fld);
$fldValue = "{$ltype}-" . $type[0]; $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)) { if (CRM_Utils_Array::value(1, $type)) {
$fldValue .= "-" . $type[1]; $fldValue .= "-" . $type[1];
...@@ -839,20 +842,20 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c ...@@ -839,20 +842,20 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c
switch ($fld) { switch ($fld) {
case 'country': case 'country':
case 'world_region': case 'world_region':
$row[$fldValue] = $i18n->crm_translate($dao->$fldValue, array('context' => 'country')); $row[$fldValue] = $i18n->crm_translate($dao->$daoField, array('context' => 'country'));
break; break;
case 'state_province': case 'state_province':
$row[$fldValue] = $i18n->crm_translate($dao->$fldValue, array('context' => 'province')); $row[$fldValue] = $i18n->crm_translate($dao->$daoField, array('context' => 'province'));
break; break;
case 'im_provider': case 'im_provider':
$imFieldvalue = $fldValue . "-provider_id"; $imFieldvalue = $daoField . "-provider_id";
$row[$fldValue] = CRM_Utils_Array::value($dao->$imFieldvalue, $imProviders); $row[$fldValue] = CRM_Utils_Array::value($dao->$imFieldvalue, $imProviders);
break; break;
default: default:
$row[$fldValue] = $dao->$fldValue; $row[$fldValue] = $dao->$daoField;
break; break;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment