From 57ff84664dda81c529d88ded14d8c132f2a4124e Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 1 Oct 2020 18:37:13 +1300 Subject: [PATCH] [REF] Fix some more calls to getTokens to make it clear only the first return value is used --- CRM/Mailing/Page/Preview.php | 6 +++--- CRM/Pledge/BAO/Pledge.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CRM/Mailing/Page/Preview.php b/CRM/Mailing/Page/Preview.php index 4d7981481d..565388b023 100644 --- a/CRM/Mailing/Page/Preview.php +++ b/CRM/Mailing/Page/Preview.php @@ -60,15 +60,15 @@ class CRM_Mailing_Page_Preview extends CRM_Core_Page { $returnProperties = $mailing->getReturnProperties(); $params = ['contact_id' => $session->get('userID')]; - $details = CRM_Utils_Token::getTokenDetails($params, + [$details] = CRM_Utils_Token::getTokenDetails($params, $returnProperties, TRUE, TRUE, NULL, $mailing->getFlattenedTokens(), get_class($this) ); - // $details[0] is an array of [ contactID => contactDetails ] + // $details is an array of [ contactID => contactDetails ] $mime = &$mailing->compose(NULL, NULL, NULL, $session->get('userID'), $fromEmail, $fromEmail, - TRUE, $details[0][$session->get('userID')], $attachments + TRUE, $details[$session->get('userID')], $attachments ); if ($type == 'html') { diff --git a/CRM/Pledge/BAO/Pledge.php b/CRM/Pledge/BAO/Pledge.php index 31f8fbc3c4..9bc13cda31 100644 --- a/CRM/Pledge/BAO/Pledge.php +++ b/CRM/Pledge/BAO/Pledge.php @@ -587,13 +587,13 @@ GROUP BY currency foreach ($fields as $key => $val) { $returnProperties[$val] = TRUE; } - $details = CRM_Utils_Token::getTokenDetails($ids, + [$details] = CRM_Utils_Token::getTokenDetails($ids, $returnProperties, TRUE, TRUE, NULL, $tokens, get_class($form) ); - $form->assign('contact', $details[0][$params['contact_id']]); + $form->assign('contact', $details[$params['contact_id']]); // handle custom data. if (!empty($params['hidden_custom'])) { -- 2.25.1