Error when Renew with new Membership Type and Pay Later

Created on 3 September 2020, almost 4 years ago
Updated 3 December 2023, 7 months ago

1.0 Problem
If a Membership is renewed, and the Membership Type changed, and payment is made using Pay Later, then:
- After the webform is submitted the Membership Status is set to Pending, and the End Date is moved forward by one year (for a one year membership).
- When the payment is recorded the End Date is set to 1/4/1970, and the Status to New.

By contrast if the Membership Type is not changed, then the End Date and Status are left unchanged when the webform is submitted, but moved a year forward and set to Current when the payment is received.

2.0 Detailed steps to reproduce (embed screenshots)
Configure webform with two membership types and Pay Later option, and renew membership as described. Receive payment through the CiviCRM administrator's screen.

3.0 Proposed resolution
I can see a possible reason for setting the status to Pending if the Type is changed, in that there may be a higher fee due which may not arrive. But on the other hand the fee due may be less, and either way the existing membership still has the remainder of its term, plus Grace period, to run and should not be immediately cut off.

In the absence of a more sophisticated mechanism for dealing with upgrades and two memberships running in parallel for the transition period (which I am not suggesting), I think the balance is in favour of changing the Type at once, and otherwise behaving in the same way as if the Type remained the same.

The Status is set to Pending on line 1166 of the file wf_crm_webform_postprocess. This depends on the check for a change in the Membership Type on line 1142 if ($mem['membership_type_id'] == $params['membership_type_id']) {
If the test on line 1142 is removed the system behaves as I suggest.

Setting the End Date to 1/4/1970 (presumably some empty value) would seem to be a separate error in CiviCRM Core, only triggered in this particular scenario. I have not investigated this further, but it does mean that the impact of the current approach is significantly greater.

πŸ› Bug report
Status

Active

Version

5.1

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.69.0 2024