Skip to content

Commit

Permalink
Merge pull request #30499 from eileenmcnaughton/no_pay
Browse files Browse the repository at this point in the history
Move the switch to variable rather than array key up a little higher
  • Loading branch information
colemanw authored Jun 20, 2024
2 parents d115a91 + d3191d9 commit 9c1e82d
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -2321,42 +2321,42 @@ public function composeMessageArray($input, $ids, $values = [], $returnMessageTe
}
}

$eventID = isset($ids['event']) ? (int) $ids['event'] : NULL;
$participantID = isset($ids['participant']) ? (int) $ids['participant'] : NULL;
$contributionID = (int) $this->id;
$contactID = (int) $ids['contact'];
$onbehalfDedupeAlert = $ids['onbehalf_dupe_alert'] ?? NULL;
// not sure whether it is possible for this not to be an array - load related contacts loads an array but this code was expecting a string
// the addition of the casting is in case it could get here & be a string. Added in 4.6 - maybe remove later? This AuthorizeNetIPN & PaypalIPN tests hit this
// line having loaded an array
$membershipIDs = !empty($ids['membership']) ? (array) $ids['membership'] : NULL;
unset($ids);

if ($this->_component != 'contribute') {
// we are in event mode
// make sure event exists and is valid
$event = new CRM_Event_BAO_Event();
$event->id = $ids['event'];
if ($ids['event'] &&
$event->id = $eventID;
if ($eventID &&
!$event->find(TRUE)
) {
throw new CRM_Core_Exception("Could not find event: " . $ids['event']);
throw new CRM_Core_Exception("Could not find event: " . $eventID);
}

$this->_relatedObjects['event'] = &$event;

$participant = new CRM_Event_BAO_Participant();
$participant->id = $ids['participant'];
if ($ids['participant'] &&
$participant->id = $participantID;
if ($participantID &&
!$participant->find(TRUE)
) {
throw new CRM_Core_Exception("Could not find participant: " . $ids['participant']);
throw new CRM_Core_Exception("Could not find participant: " . $participantID);
}
$participant->register_date = CRM_Utils_Date::isoToMysql($participant->register_date);

$this->_relatedObjects['participant'] = &$participant;
}

$eventID = isset($ids['event']) ? (int) $ids['event'] : NULL;
$participantID = isset($ids['participant']) ? (int) $ids['participant'] : NULL;
$contributionID = (int) $this->id;
$contactID = (int) $ids['contact'];
$onbehalfDedupeAlert = $ids['onbehalf_dupe_alert'] ?? NULL;
// not sure whether it is possible for this not to be an array - load related contacts loads an array but this code was expecting a string
// the addition of the casting is in case it could get here & be a string. Added in 4.6 - maybe remove later? This AuthorizeNetIPN & PaypalIPN tests hit this
// line having loaded an array
$membershipIDs = !empty($ids['membership']) ? (array) $ids['membership'] : NULL;
unset($ids);

//not really sure what params might be passed in but lets merge em into values
$values = array_merge($this->_gatherMessageValues($values, $eventID, $participantID), $values);
$values['is_email_receipt'] = !$returnMessageText;
Expand Down

0 comments on commit 9c1e82d

Please sign in to comment.