Skip to content

Commit

Permalink
Merge branch 'issue/101'
Browse files Browse the repository at this point in the history
[#101] Unlock settings not applied correctly due to ID mismatches
  • Loading branch information
jensschuppe committed Apr 23, 2020
2 parents 40b383a + e0b8d14 commit 34c65c1
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 34c65c1

Please sign in to comment.