-
-
Notifications
You must be signed in to change notification settings - Fork 812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRM-21409 Don't bypass hooks when updating contribution receipt/thankyou date #11257
CRM-21409 Don't bypass hooks when updating contribution receipt/thankyou date #11257
Conversation
Jenkins re test this please |
jenkins, test this please |
Jenkins test this please |
@bgm @seamuslee001 Woo! Finally passing, did not see how that could possibly be related to this PR! |
} | ||
if ($receipt_update || $thankyou_update) { | ||
$result = civicrm_api3('Contribution', 'create', $contributionParams); | ||
if (empty($result['is_error'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if is invalid - there will be an exception thrown rather than an error returned. There are no obvious reasons why an exception would be thrown so I think it's OK not to add any handling for the possibility.
Also - I'm not 100% sure about the ternarys below. I would make it
$receipts = ($receipt_update ? $receipts + 1 : $receipts);
I made some minor comments but overall this change makes sense to me |
5805be4
to
fd57820
Compare
@eileenmcnaughton Thanks for reviewing. I've updated based on your comments. |
test this please |
I think this is good to merge now. Re-running tests |
@eileenmcnaughton this has passed testing now |
Yay |
…df_letter_hooks CRM-21409 Don't bypass hooks when updating contribution receipt/thankyou date
Overview
Use the API instead of directly accessing DAO object. This fixes a "todo" in the code and means that the entity changes will trigger any necessary hooks instead of bypassing them.