compucorp / uk.co.compucorp.membershipextras

Membership Extras for CiviCRM
Other
5 stars 8 forks source link

MAE-397: Fix Membership Deletion #312

Closed MiyaNoctem closed 3 years ago

MiyaNoctem commented 3 years ago

Overview

When you try to delete a membership, a popup is shown to confirm the deletion. After confirming, popup keeps on running on the same page and no deletion is happens.

Before

As part of the membership deletion process, all contributions related to the membership are deleted to. After deletion, a post hook is triggered, which in turn executes our Post membership payment hook. This hook used a getvalue API call on the Contribution's entity to obtain the related recurring contribution, however, by this time related contributions had already been deleted. Thus an exception was thrown by the API call.

After

Changed the API call from getvalue to get, so we can check the count before trying to access the value for recurring contribution ID.