Eileen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/271018

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, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/18/271018/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 105e02f..e1aafb6 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -2086,12 +2086,13 @@
         $wmf_donor["is_{$fiscal_year}_donor"] = TRUE;
       }
       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 ? TRUE : FALSE;
       }
                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/271018
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c4fcd64028158c673ef708a989da5b97c57a06b
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Eileen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to