Open michaelbeil opened 3 years ago
We should check in core:
pmpro_changeMembershipLevel
in place of pmpro_cancelMembershipLevel
with $cancel_level = null
pmpro_cancelMembershipLevel
with $cancel_level = null
Every time the $cancel_level is set, CONPD recognize it as "cancel the automatic renewal"; when the $cancel_level is not set, CONPD can't do its job and the membership is just cancelled (deactivated).
Yes, Mirco found the problem.
One solution would be to detect when 'all' is passed and swap that out for a list of level ids. This would ensure the levels are looped through and cancelled one by one.
This would fix the issue with CONP but also change the behavior to sending multiple emails... one per level. This might be preferred. The "your membership will expire on..." value CONP swaps in is going to be for one level only if you are cancelling multiple levels.
In the meantime, here is a gist that does this: https://gist.github.com/ideadude/b4237c338e47161ca726a5fcf569465a
We would probably just want to update the preheader/cancel.php file to do this swap if we updated core to do this.
It's also just a good idea in general to go around swapping out calls to pmpro_changeMembershipLevel(0, ...) to pmpro_cancelMembershipLevel() where applicable. In add ons in particular, we wanted to wait a while for people to update PMPro core, but we've waited long enough.
Similar issue, please: ##416089
Similar issue: 462744
Reported by a customer (ticket ID 477764):
on my side I could not reproduce the bug, that is to say that even if I let activate all the plugins it worked i.e. when I connected and I canceled my membership it worked fine and an expiration date was created based on the next payment date. So in fact everything was working very well BUT finally I found how to reproduce the bug and that even if all the plugins are deactivated. When I go to the “membership cancellation” menu there are two buttons, the first is called “cancel” and is located on the same line as the description of my subscription and the second button is located below the list subscriptions and is entitled “cancel all my memberships”. And that’s where the bug is depending on which button I’m using. If I click on “cancelled” all is working fine, the expiration for later is created, but if I click on “cancel all my memberships” then in this case it does not work and the subscription expires immediately.
Sent the gist.
Describe the bug When you click Cancel All Memberships on the Membership Cancel page, the member is completely canceled. A member saw this, and then their membership was no longer active as reported in ticket 350073 (moderators only).
To Reproduce Steps to reproduce the behavior:
Screenshots Screen video
Expected behavior I expected the membership to stay active.
Isolating the problem:
WordPress Environment