* Arguably the form should start to build $this->_params in the pre-process main page & use that array consistently throughout.
*/
protected function setRecurringMembershipParams() {
+ if (!empty($this->_params['priceSetId']) && !empty($this->_params['selectMembership'])) {
+ // @todo the price_x fields will ALWAYS allow us to determine the membership - so we should ignore
+ // 'selectMembership' and calculate from the price_x fields so we have one method that always works
+ // this is lazy & only catches when selectMembership is set, but the worst of all worlds would be to fix
+ // this with an else (calculate for price set).
+ $membershipTypes = CRM_Price_BAO_PriceSet::getMembershipTypesFromPriceSet($this->_params['priceSetId']);
+ if (in_array($this->_params['selectMembership'], $membershipTypes['autorenew'])) {
+ $this->_params['auto_renew'] = TRUE;
+ }
+ }
if ((!empty($this->_params['selectMembership']) || !empty($this->_params['priceSetId'])) && !empty($this->_paymentProcessor['is_recur']) &&
CRM_Utils_Array::value('auto_renew', $this->_params) && empty($this->_params['is_recur']) && empty($this->_params['frequency_interval'])
) {