jenkins-bot has submitted this change and it was merged.
Change subject: Fix type error in Refund logic.
......................................................................
Fix type error in Refund logic.
The function being called in the mark-refund code to set the custom field is
less tolerant than the api &
does not accept True-ish values for boolean fields. We hit an error where it
passed 2 as the number of contributions this year to the custom field setValues
function & it was rejected as a non boolean. This is a follow up on a recent
change.
Bug: T124979
Change-Id: I3c4fcd64028158c673ef708a989da5b97c57a06b
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Ejegg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 105e02f..ec68c09 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -2083,15 +2083,16 @@
}
if ( $fiscal_year >= WMF_MIN_ROLLUP_YEAR && $fiscal_year <=
WMF_MAX_ROLLUP_YEAR ) {
if (!$isNegative) {
- $wmf_donor["is_{$fiscal_year}_donor"] = TRUE;
+ $wmf_donor["is_{$fiscal_year}_donor"] = 1;
}
else {
- $wmf_donor["is_{$fiscal_year}_donor"] = civicrm_api3('Contribution',
'getcount', array(
+ $donationsCount = civicrm_api3('Contribution', 'getcount', array(
'contact_id' => $contact_id,
'contribution_status_id' => 'Completed',
'receive_date' => array('BETWEEN' => array($fiscal_year . '-07-01',
$fiscal_year +1 . '-06-30')),
'total_amout' => array('>' => 0),
));
+ $wmf_donor["is_{$fiscal_year}_donor"] = $donationsCount ? 1 : 0;
}
}
--
To view, visit https://gerrit.wikimedia.org/r/271018
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3c4fcd64028158c673ef708a989da5b97c57a06b
Gerrit-PatchSet: 3
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Eileen <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Cdentinger <[email protected]>
Gerrit-Reviewer: Eileen <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits