[Ref] Remove never reachable lines.
authoreileen <emcnaughton@wikimedia.org>
Fri, 5 Jun 2020 05:40:09 +0000 (17:40 +1200)
committereileen <emcnaughton@wikimedia.org>
Mon, 8 Jun 2020 22:13:16 +0000 (10:13 +1200)
There is an early return on  so updateStatusId can never be true

CRM/Member/Form/MembershipRenewal.php

index 894f70123098086848b69c20d3bbc4550dbb2ff3..6a6d41cb6cf2fcbd156083182591c498a1e923dc 100644 (file)
@@ -748,7 +748,6 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
    * @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);
@@ -855,23 +854,12 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
       }
       $memParams['membership_activity_status'] = ($pending || $isPayLater) ? 'Scheduled' : 'Completed';
     }
-    //CRM-4555
-    if ($pending) {
-      $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.