X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FBatch%2FForm%2FEntry.php;h=9baf89a4fd65cfbf1fbbb738fb050d2782c01507;hb=61767a1d73296c1b3d986070bee26982169fca66;hp=a9e24bcd82bf66292c7c7dad24fea0d177bd0d53;hpb=21d8b8e9a7b04aba56b1c511929081cb83056067;p=civicrm-core.git diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index a9e24bcd82..9baf89a4fd 100755 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -64,7 +64,6 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { public $_params; - public $_membershipId = NULL; /** * When not to reset sort_name. */ @@ -787,19 +786,23 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { $value['is_renew'] = FALSE; if (!empty($params['member_option']) && CRM_Utils_Array::value($key, $params['member_option']) == 2) { + + // The following parameter setting may be obsolete. $this->_params = $params; $value['is_renew'] = TRUE; - $membership = CRM_Member_BAO_Membership::renewMembershipFormWrapper( - $value['contact_id'], - $value['membership_type_id'], - FALSE, - $this, - NULL, - NULL, - $value['custom'], - 1, - NULL, - FALSE + $isPayLater = CRM_Utils_Array::value('is_pay_later', $params); + $campaignId = NULL; + if (isset($this->_values) && is_array($this->_values) && !empty($this->_values)) { + $campaignId = CRM_Utils_Array::value('campaign_id', $this->_params); + if (!array_key_exists('campaign_id', $this->_params)) { + $campaignId = CRM_Utils_Array::value('campaign_id', $this->_values); + } + } + + list($membership) = CRM_Member_BAO_Membership::renewMembership( + $value['contact_id'], $value['membership_type_id'], FALSE, + NULL, NULL, $value['custom'], NULL, NULL, FALSE, + NULL, NULL, $isPayLater, $campaignId ); // make contribution entry