X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FMember%2FBAO%2FMembership.php;h=c927be1aff4a24cb6288002bce62e7b033cce411;hb=ab5db05b03f85c2b750f46ecb83a09c7777a99a1;hp=df5e17a48d3cd6e45c4d338f5531315dd2cc3a96;hpb=51b9c47ebf0137e025250203e128abde4f1614d9;p=civicrm-core.git diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index df5e17a48d..c927be1aff 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -1062,7 +1062,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND */ public static function getMembershipCount($membershipTypeId, $date = NULL, $isTest = 0, $isOwner = 0) { if (!CRM_Utils_Rule::date($date)) { - CRM_Core_Error::fatal(ts('Invalid date "%1" (must have form yyyy-mm-dd).', [1 => $date])); + throw new CRM_Core_Exception(ts('Invalid date "%1" (must have form yyyy-mm-dd).', [1 => $date])); } $params = [ @@ -1821,8 +1821,8 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND if ($contributionRecurID) { $memParams['contribution_recur_id'] = $contributionRecurID; } - // @todo stop passing $ids - it is empty - $membership = self::create($memParams, $ids); + + $membership = self::create($memParams); return [$membership, $renewalMode, $dates]; } @@ -1852,12 +1852,6 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND if (!empty($membershipSource)) { $currentMembership['source'] = $membershipSource; } - else { - $currentMembership['source'] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', - $currentMembership['id'], - 'source' - ); - } if (!empty($currentMembership['id'])) { $ids['membership'] = $currentMembership['id']; @@ -1910,10 +1904,6 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND } $memParams['membership_activity_status'] = ($pending || $isPayLater) ? 'Scheduled' : 'Completed'; } - //CRM-4555 - if ($pending) { - $updateStatusId = array_search('Pending', $allStatus); - } } else { // NEW Membership