Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.2.8
-
Fix Version/s: 4.3.0
-
Component/s: CiviMember
-
Labels:None
Description
CRM_Member_BAO_Membership::deleteMembership() constructs a sparse membership on line 596, which is later passed on to post hook implementations at line 601. deleteMembership should retrieve and pass the whole membership to the CRM_Utils_Hook::post() call because by the time the hook implementations are invoked the membership has already been deleted from the database and its components (e.g., contact_id) cannot be recovered by the V3 API.
This bug is causing civicrm_member_roles_civicrm_post() to resync member roles for all contacts when a membership is deleted and the civicrm_member_roles_sync_method == 3. In this case, a missing contact_id field in the passed membership is interpreted as a request to sync all contacts.
Patch attached.
Attachments
Issue Links
- is supplemented by
-
CRM-13109 API.Membership.delete fatals on invalid id
- Done/Fixed