Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] Remove pass-by-reference & always empty param #17984

Merged
merged 1 commit into from
Aug 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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