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 never reachable lines. #17556

Merged
merged 1 commit into from
Jun 9, 2020
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
12 changes: 0 additions & 12 deletions CRM/Member/Form/MembershipRenewal.php
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,6 @@ protected function sendReceipt($membership) {
* @throws \CiviCRM_API3_Exception
*/
public function processMembership($contactID, $membershipTypeID, $is_test, $changeToday, $customFieldsFormatted, $numRenewTerms, $membershipID, $pending, $contributionRecurID, $isPayLater) {
$updateStatusId = FALSE;
$allStatus = CRM_Member_PseudoConstant::membershipStatus();
$format = '%Y%m%d';
$membershipTypeDetails = CRM_Member_BAO_MembershipType::getMembershipTypeDetails($membershipTypeID);
Expand Down Expand Up @@ -855,23 +854,12 @@ public function processMembership($contactID, $membershipTypeID, $is_test, $chan
}
$memParams['membership_activity_status'] = ($pending || $isPayLater) ? 'Scheduled' : 'Completed';
}
//CRM-4555
if ($pending) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eileenmcnaughton are you saying that this couldn't ever be true?

$pending = ($this->_params['contribution_status_id'] == CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Pending'));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seamuslee001 yes see how

if ($pending || in_array($currentMembership['status_id'], [
results in it returning before that line?

(I think the same may be the case in the function on the BAO class that this form used to share)

$updateStatusId = array_search('Pending', $allStatus);
}

// Putting this in an IF is precautionary as it seems likely that it would be ignored if empty, but
// perhaps shouldn't be?
if ($contributionRecurID) {
$memParams['contribution_recur_id'] = $contributionRecurID;
}
//CRM-4555
//if we decided status here and want to skip status
//calculation in create( ); then need to pass 'skipStatusCal'.
if ($updateStatusId) {
$memParams['status_id'] = $updateStatusId;
$memParams['skipStatusCal'] = TRUE;
}

//since we are renewing,
//make status override false.
Expand Down