}
CRM_Member_BAO_MembershipLog::add($logParams);
- if (!empty($contributionRecurID)) {
+ if ($contributionRecurID) {
CRM_Core_DAO::setFieldValue('CRM_Member_DAO_Membership', $membership->id,
'contribution_recur_id', $contributionRecurID
);
if (!empty($membershipSource)) {
$memParams['source'] = $membershipSource;
}
- $memParams['contribution_recur_id'] = $contributionRecurID;
-
$memParams['is_test'] = $is_test;
$memParams['is_pay_later'] = $isPayLater;
}
-
+ // 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'.
'return' => $mapping,
));
+ $returnParams = array('is_recur' => TRUE);
foreach ($mapping as $recurringFieldName => $membershipTypeFieldName) {
$contributionRecurParams[$recurringFieldName] = $membershipType[$membershipTypeFieldName];
+ $returnParams[$recurringFieldName] = $membershipType[$membershipTypeFieldName];
}
$contributionRecur = civicrm_api3('ContributionRecur', 'create', $contributionRecurParams);
- $returnParams = array(
- 'contributionRecurID' => $contributionRecur['id'],
- 'is_recur' => TRUE,
- );
+ $returnParams['contributionRecurID'] = $contributionRecur['id'];
return $returnParams;
}
if (empty($this->_params['financial_type_id'])) {
$this->_params['financial_type_id'] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $this->_memType, 'financial_type_id');
}
-
+ $contributionRecurID = NULL;
$this->assign('membershipID', $this->_id);
$this->assign('contactID', $this->_contactID);
$this->assign('module', 'Membership');
if (!empty($this->_params['auto_renew'])) {
$contributionRecurParams = $this->processRecurringContribution($paymentParams);
+ $contributionRecurID = $contributionRecurParams['contributionRecurID'];
$paymentParams = array_merge($paymentParams, $contributionRecurParams);
}