Awight has uploaded a new change for review.

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

Change subject: fix weak fail on missing initial contribution
......................................................................

fix weak fail on missing initial contribution

Orphaned subscription is an error for recurring Globalcollect.

Change-Id: I6db14ed63b087958ff9122f116e2b8322c53898a
---
M sites/all/modules/wmf_civicrm/recurring.inc
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/14/149614/1

diff --git a/sites/all/modules/wmf_civicrm/recurring.inc 
b/sites/all/modules/wmf_civicrm/recurring.inc
index a8b1ec3..68b0f19 100644
--- a/sites/all/modules/wmf_civicrm/recurring.inc
+++ b/sites/all/modules/wmf_civicrm/recurring.inc
@@ -375,7 +375,9 @@
  *
  * @param integer $contribution_recur_id
  *
- * @return array|false $contribution
+ * @return array $contribution
+ *
+ * @throws WmfException if no matching subscription exists.
  */
 function wmf_civicrm_get_initial_recurring_contribution( 
$contribution_recur_id ) {
     $sql = "
@@ -390,7 +392,7 @@
     
     $out = wmf_civicrm_dao_to_list( $res );
     if ( !$out ) {
-        return false;
+        throw new WmfException( 'MISSING_PREDECESSOR', 'No such recurring 
contribution, id=' . $contribution_recur_id );
     }
     return array_pop($out);
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6db14ed63b087958ff9122f116e2b8322c53898a
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Awight <awi...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to