list($outputColumns, $metadata) = self::getExportStructureArrays($returnProperties, $processor);
+ if (!empty($exportParams['merge_same_address']['temp_columns'])) {
+ // @todo - this is a temp fix - ideally later we don't set stuff only to unset it.
+ // test exists covering this...
+ foreach (array_keys($exportParams['merge_same_address']['temp_columns']) as $field) {
+ $processor->setColumnAsCalculationOnly($field);
+ }
+ }
+
$paymentDetails = [];
if ($processor->isExportPaymentFields()) {
// get payment related in for event and members
}
else {
// return tableName sqlColumns headerRows in test context
- return array($exportTempTable, $sqlColumns, $headerRows);
+ return array($exportTempTable, $sqlColumns, $headerRows, $processor);
}
// delete the export temp table and component table
}
// unset temporary columns that were added for postal mailing format
+ // @todo - this part is pretty close to ready to be removed....
if (!empty($exportParams['merge_same_address']['temp_columns'])) {
$unsetKeys = array_keys($sqlColumns);
foreach ($unsetKeys as $headerKey => $sqlColKey) {
));
//export and merge contacts with same address
- list($tableName) = CRM_Export_BAO_Export::exportComponents(
+ list($tableName, $sqlColumns, $headerRows, $processor) = CRM_Export_BAO_Export::exportComponents(
TRUE,
array($contactA['id'], $contactB['id']),
array(),
)
);
+ $this->assertTrue(!in_array('state_province_id', $processor->getHeaderRows()));
$greeting = CRM_Core_DAO::singleValueQuery("SELECT email_greeting FROM {$tableName}");
//Assert email_greeting is not merged