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

Simplify params on now-private function #25182

Merged
merged 1 commit into from
Dec 15, 2022
Merged
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
21 changes: 5 additions & 16 deletions CRM/Contribute/Form/Contribution/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,6 @@ public function buildQuickForm() {
if (empty($this->_values['pledge_id']) && empty($this->_ccid)) {
$this->_separateMembershipPayment = FALSE;
if (CRM_Core_Component::isEnabled('CiviMember')) {
$isTest = 0;
if ($this->_action & CRM_Core_Action::PREVIEW) {
$isTest = 1;
}

if ($this->_priceSetId &&
(CRM_Core_Component::getComponentID('CiviMember') == CRM_Utils_Array::value('extends', $this->_priceSet))
Expand All @@ -374,11 +370,7 @@ public function buildQuickForm() {
$this->set('useForMember', $this->_useForMember);
}

$this->_separateMembershipPayment = $this->buildMembershipBlock(
$this->_membershipContactID,
NULL,
$isTest
);
$this->_separateMembershipPayment = $this->buildMembershipBlock();
}
$this->set('separateMembershipPayment', $this->_separateMembershipPayment);
}
Expand Down Expand Up @@ -523,18 +515,15 @@ public function buildQuickForm() {
* @todo this was shared on CRM_Contribute_Form_ContributionBase but we are refactoring and simplifying for each
* step (main/confirm/thankyou)
*
* @param int $cid
* Contact checked for having a current membership for a particular membership.
* @param int|array $selectedMembershipTypeID
* Selected membership id.
* @param null $isTest
*
* @return bool
* Is this a separate membership payment
*
* @throws \CRM_Core_Exception
*/
private function buildMembershipBlock($cid, $selectedMembershipTypeID = NULL, $isTest = NULL) {
private function buildMembershipBlock() {
$cid = $this->_membershipContactID;
$isTest = (bool) ($this->_action & CRM_Core_Action::PREVIEW);
$selectedMembershipTypeID = NULL;
$separateMembershipPayment = FALSE;
$this->addOptionalQuickFormElement('auto_renew');
if ($this->_membershipBlock) {
Expand Down