Skip to content

Commit

Permalink
Merge pull request #17984 from eileenmcnaughton/sendref
Browse files Browse the repository at this point in the history
[REF] Remove pass-by-reference & always empty param
  • Loading branch information
seamuslee001 authored Aug 1, 2020
2 parents 2e9dcd6 + 0d07fe4 commit a025e4e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
7 changes: 2 additions & 5 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -4598,8 +4598,6 @@ public static function completeOrder($input, &$ids, $objects, $transaction = NUL
* @param array $ids
* Related object IDs.
* @param int $contributionID
* @param array $values
* Values related to objects that have already been loaded.
* @param bool $returnMessageText
* Should text be returned instead of sent. This.
* is because the function is also used to generate pdfs
Expand All @@ -4609,9 +4607,8 @@ public static function completeOrder($input, &$ids, $objects, $transaction = NUL
* @throws \CiviCRM_API3_Exception
* @throws \Exception
*/
public static function sendMail(&$input, &$ids, $contributionID, &$values,
$returnMessageText = FALSE) {

public static function sendMail($input, $ids, $contributionID, $returnMessageText = FALSE) {
$values = [];
$contribution = new CRM_Contribute_BAO_Contribution();
$contribution->id = $contributionID;
if (!$contribution->find(TRUE)) {
Expand Down
4 changes: 1 addition & 3 deletions CRM/Contribute/Form/Task/PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ public function postProcess() {
// CRM_Contribute_BAO_Contribution::composeMessageArray expects mysql formatted date
$objects['contribution']->receive_date = CRM_Utils_Date::isoToMysql($objects['contribution']->receive_date);

$values = [];
if (isset($params['from_email_address']) && !$elements['createPdf']) {
// If a logged in user from email is used rather than a domain wide from email address
// the from_email_address params key will be numerical and we need to convert it to be
Expand All @@ -196,8 +195,7 @@ public function postProcess() {
$input['receipt_from_name'] = str_replace('"', '', $fromDetails[0]);
}

$mail = CRM_Contribute_BAO_Contribution::sendMail($input, $ids, $objects['contribution']->id, $values,
$elements['createPdf']);
$mail = CRM_Contribute_BAO_Contribution::sendMail($input, $ids, $objects['contribution']->id, $elements['createPdf']);

if ($mail['html']) {
$message[] = $mail['html'];
Expand Down
4 changes: 2 additions & 2 deletions api/v3/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ function _civicrm_api3_contribute_format_params($params, &$values) {
* @throws Exception
*/
function civicrm_api3_contribution_sendconfirmation($params) {
$ids = $values = [];
$ids = [];
$allowedParams = [
'receipt_from_email',
'receipt_from_name',
Expand All @@ -405,7 +405,7 @@ function civicrm_api3_contribution_sendconfirmation($params) {
];
$input = array_intersect_key($params, array_flip($allowedParams));
$input['is_email_receipt'] = TRUE;
CRM_Contribute_BAO_Contribution::sendMail($input, $ids, $params['id'], $values);
CRM_Contribute_BAO_Contribution::sendMail($input, $ids, $params['id']);
}

/**
Expand Down

0 comments on commit a025e4e

Please sign in to comment.