Commit 46e6a0e1 authored by colemanw's avatar colemanw Committed by GitHub

Merge pull request #14819 from eileenmcnaughton/export_up

[REF] [Export] Stop passing export params to the merge function
parents 5867d446 423e3da6
......@@ -1851,11 +1851,10 @@ class CRM_Export_BAO_ExportProcessor {
/**
* @param int $contactId
* @param array $exportParams
*
* @return array
*/
public function replaceMergeTokens($contactId, $exportParams) {
public function replaceMergeTokens($contactId) {
$greetings = [];
$contact = NULL;
......@@ -1864,7 +1863,8 @@ class CRM_Export_BAO_ExportProcessor {
'addressee' => $this->getAddresseeGreetingTemplate(),
];
foreach ($greetingFields as $greeting => $greetingLabel) {
if (!empty($exportParams[$greeting])) {
$tokens = CRM_Utils_Token::getTokens($greetingLabel);
if (!empty($tokens)) {
if (empty($contact)) {
$values = [
'id' => $contactId,
......@@ -1911,7 +1911,7 @@ class CRM_Export_BAO_ExportProcessor {
if (!$sharedAddress) {
if (!isset($this->contactGreetingFields[$dao->master_contact_id])) {
$this->contactGreetingFields[$dao->master_contact_id] = $this->replaceMergeTokens($dao->master_contact_id, $exportParams);
$this->contactGreetingFields[$dao->master_contact_id] = $this->replaceMergeTokens($dao->master_contact_id);
}
$masterPostalGreeting = CRM_Utils_Array::value('postal_greeting',
$this->contactGreetingFields[$dao->master_contact_id], $dao->master_postal_greeting
......@@ -1921,7 +1921,7 @@ class CRM_Export_BAO_ExportProcessor {
);
if (!isset($contactGreetingTokens[$dao->copy_contact_id])) {
$this->contactGreetingFields[$dao->copy_contact_id] = $this->replaceMergeTokens($dao->copy_contact_id, $exportParams);
$this->contactGreetingFields[$dao->copy_contact_id] = $this->replaceMergeTokens($dao->copy_contact_id);
}
$copyPostalGreeting = CRM_Utils_Array::value('postal_greeting',
$this->contactGreetingFields[$dao->copy_contact_id], $dao->copy_postal_greeting
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment