I see this line in CRM_Contribute_BAO_Contribution
:
//update pledge and pledge payment, CRM-3961
CRM_Pledge_BAO_PledgePayment::resetPledgePayment($id);
Looking at CRM_Pledge_BAO_PledgePayment::resetPledgePayment()
, I see it calls the DAO method, not the BAO - which is why the hooks (which ARE present) are bypassed.
I think this would be a good enhancement for core CiviCRM. CRM_Pledge_BAO_PledgePayment::resetPledgePayment()
is a very short function, which could be easily refactored to instantiate the PledgePayment BAO instead of DAO, and call the add()
or create()
method instead of commit()
. This would cause your hooks to fire.