Skip to content

Commit

Permalink
Merge pull request #16016 from seamuslee001/master
Browse files Browse the repository at this point in the history
5.20
  • Loading branch information
seamuslee001 authored Dec 3, 2019
2 parents 671c601 + 3cfdbf4 commit a43ea4b
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions CRM/Contribute/Form/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ public function preProcess() {

parent::preProcess();

//membership ID
$memberShipId = CRM_Utils_Request::retrieve('memberId', 'Positive', $this);
if (isset($memberShipId)) {
$this->_formValues['contribution_membership_id'] = $memberShipId;
}
$participantId = CRM_Utils_Request::retrieve('participantId', 'Positive', $this);
if (isset($participantId)) {
$this->_formValues['contribution_participant_id'] = $participantId;
}

$this->_queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_formValues);
$selector = new CRM_Contribute_Selector_Search($this->_queryParams,
Expand Down Expand Up @@ -131,6 +122,18 @@ public function setDefaultValues() {
'Completed'
);
}

// The membership or contribution id could be set on the form if viewing
// an embedded block on ParticipantView or MembershipView.
$memberShipId = CRM_Utils_Request::retrieve('memberId', 'Positive', $this);
if (isset($memberShipId)) {
$this->_defaults['contribution_membership_id'] = $memberShipId;
}
$participantId = CRM_Utils_Request::retrieve('participantId', 'Positive', $this);
if (isset($participantId)) {
$this->_defaults['contribution_participant_id'] = $participantId;
}

return $this->_defaults;
}

Expand Down

0 comments on commit a43ea4b

Please sign in to comment.