Details
-
Type: Bug
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: 4.5
-
Fix Version/s: Unscheduled
-
Component/s: None
-
Labels:None
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:Developer Doc
Description
We are trying to track down a case where hooks are not called. I'm not sure if these are our problem but
CRM_Membership_BAO_Member::fixMembershipStatusBeforeRenew & updateRelatedMemberships both do $dao->save() which bypasses the hooks
I'm going to trial this on updateRelatedMemberships - but not sure this is the instance where it is 'missing' for us
@@ -1615,19 +1615,10 @@ SELECT c.contribution_page_id as pageID
- @static
*/
static function updateRelatedMemberships($ownerMembershipId, $params) {
- $membership = new CRM_Member_DAO_Membership();
- $membership->owner_membership_id = $ownerMembershipId;
- $membership->find();
- - while ($membership->fetch())
{
- $relatedMembership = new CRM_Member_DAO_Membership();
- $relatedMembership->id = $membership->id;
- $relatedMembership->copyValues($params);
- $relatedMembership->save();
- $relatedMembership->free();
- }
-
- $membership->free();
+ civicrm_api3('membership', 'get', array(
+ 'owner_membership_id' => $ownerMembershipId,
+ 'api.membership.create' => $params,
+ ));
}