Skip to content

Commit

Permalink
[#101] Use receipt instead of receipt item ID for retrieving profile …
Browse files Browse the repository at this point in the history
…settings when validating contributions
  • Loading branch information
jensschuppe committed Apr 23, 2020
1 parent a6acaab commit e0b8d14
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion CRM/Donrec/Logic/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,18 @@ public static function getContributionUnlockableFields() {
public static function validateContribution($contribution_id, $old_values, $new_values, $throw_exception = FALSE) {
$errors = array();

$receipt_id = CRM_Donrec_Logic_ReceiptItem::hasValidReceiptItem($contribution_id, TRUE);
if (!empty($receipt_id = CRM_Donrec_Logic_Receipt::getReceiptIDsByContributionID(
$contribution_id,
0,
60,
'ORIGINAL'
))) {
$receipt_id = reset($receipt_id);
}
else {
$receipt_id = FALSE;
}

$snapshot_id = CRM_Donrec_Logic_Snapshot::isInOpenSnapshot($contribution_id, TRUE);

if ($receipt_id || $snapshot_id) {
Expand Down

0 comments on commit e0b8d14

Please sign in to comment.