From c419b32d25515d82694bafe2e16574991ed8e0bc Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 3 Dec 2019 18:46:21 +1300 Subject: [PATCH] dev/core#1435 Fix lack of filtering in Contribution tab on Membership or Participant View --- CRM/Contribute/Form/Search.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/CRM/Contribute/Form/Search.php b/CRM/Contribute/Form/Search.php index 1e967dca2f..65a11032ba 100644 --- a/CRM/Contribute/Form/Search.php +++ b/CRM/Contribute/Form/Search.php @@ -86,16 +86,6 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { 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; - } - $sortID = NULL; if ($this->get(CRM_Utils_Sort::SORT_ID)) { $sortID = CRM_Utils_Sort::sortIDValue($this->get(CRM_Utils_Sort::SORT_ID), @@ -163,6 +153,18 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search { '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; } -- 2.25.1