strangerstudios / pmpro-cancel-on-next-payment-date

Change membership cancellation in Paid Memberships Pro to set expiration for next payment date instead of cancelling immediately.
https://www.paidmembershipspro.com/add-ons/cancel-on-next-payment-date
8 stars 8 forks source link

Can't work if $cancel_level is not provided #33

Closed mircobabini closed 1 year ago

mircobabini commented 2 years ago

Describe the bug Sometimes $cancel_level (fourth param) is not provided into the main hook.

This causes the ->update query to fail because of the WHERE clause missing the membership_id.

mircobabini commented 2 years ago

Caused by any call of pmpro_changeMembershipLevel with just 3 params, used in place of pmpro_cancelMembershipLevel.

Example: https://github.com/strangerstudios/paid-memberships-pro/pull/1882/commits/39f5f04074c5ed62d362f8d16f94b84a13bb7c7d