Error in form validation when editing membership plans

2 replies [Last post]
laken
Offline
Joined: 03/11/2010
Status: 
Answered

Hi Leighton,

Using the D5 version of membership suite.

On the add/edit membership plan form, the help text for the "Number of Periods Until Expiration" field reads in part:

How many times to bill the user when using Recurring Subscriptions. If you put 0, it will recur forever. If you want a non-recurring membership to expire, put 1 here. If you want a non-recurring membership to last forever, put 0. If you are using a Recurring Subscription, you cannot put 1 here.

I created a recurring subscription that I never want to expire, so I put '0' there when I created the plan – fine. However when I edit the plan, and save it without editing those fields I get this error:

You must enter more than 1 payment if you are using Recurring Subscription

The problem is different validation logic in ms_membership_edit_plan_form_validate than is in ms_membership_add_plan_form_validate.

Line 2994 is: 

  1.   if (($v['srt'] < 1) && $v['src']) {
  2.     form_set_error('srt', t('You must enter more than 1 payment if you are using Recurring Subscription'));
  3.   }<br type="_moz" />

which prevents you from having a zero in that field when you're editing the plan. Should be fixed to be consistent with the add validation logic. I didn't want to code a fix myself b/c I don't totally understand all the validation.

Haven't checke to see if this bug exists in D6 version When do you think you can have a fix ready?

 Thanks,

– Andy

 

Evolver
Offline
Joined: 03/12/2010
I have a patch forth-coming.

I have a patch forth-coming.

Leighton Whiting
Offline
Joined: 06/02/2009
Bevan, Thank you for

Bevan,

Thank you for catching this, the error is that instead of the <1 it should be ==1 . This is because recurring subscriptions should be either 0 (recur forever) or some number greater than 1. If you only want 1 payment, recurring isn't needed. I'll fix this and get it rolled out in the next release. The bug was only in the 5.x version.

Sincerely,

Leighton Whiting

Twitter Feed