Skip to content

Commit

Permalink
Merge pull request #14802 from eileenmcnaughton/ex4
Browse files Browse the repository at this point in the history
[REF] [Export] Move setting of household properties to processor
  • Loading branch information
colemanw authored Jul 11, 2019
2 parents 561070c + 3611a53 commit 46a36ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 0 additions & 4 deletions CRM/Export/BAO/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,6 @@ public static function exportComponents(

list($query, $select, $from, $where, $having) = $processor->runQuery($params, $order);

if ($mergeSameHousehold == 1) {
$processor->setHouseholdMergeReturnProperties();
}

// This perhaps only needs calling when $mergeSameHousehold == 1
self::buildRelatedContactArray($selectAll, $ids, $processor, $componentTable);

Expand Down
11 changes: 7 additions & 4 deletions CRM/Export/BAO/ExportProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ public function __construct($exportMode, $requestedFields, $queryOperator, $isMe
$this->setReturnProperties($this->determineReturnProperties());
$this->setAdditionalFieldsForSameAddressMerge();
$this->setAdditionalFieldsForPostalExport();
$this->setHouseholdMergeReturnProperties();
}

/**
Expand Down Expand Up @@ -1220,10 +1221,12 @@ public function setRelationshipReturnProperties($value, $relationshipKey) {
* be retrieved.
*/
public function setHouseholdMergeReturnProperties() {
$returnProperties = $this->getReturnProperties();
$returnProperties = array_diff_key($returnProperties, array_fill_keys(['location_type', 'im_provider'], 1));
foreach ($this->getHouseholdRelationshipTypes() as $householdRelationshipType) {
$this->relationshipReturnProperties[$householdRelationshipType] = $returnProperties;
if ($this->isMergeSameHousehold()) {
$returnProperties = $this->getReturnProperties();
$returnProperties = array_diff_key($returnProperties, array_fill_keys(['location_type', 'im_provider'], 1));
foreach ($this->getHouseholdRelationshipTypes() as $householdRelationshipType) {
$this->relationshipReturnProperties[$householdRelationshipType] = $returnProperties;
}
}
}

Expand Down

0 comments on commit 46a36ce

Please sign in to comment.