Adamw has uploaded a new change for review.
https://gerrit.wikimedia.org/r/95739
Change subject: fix comment
......................................................................
fix comment
Change-Id: Id5fa40ea8d89ccc1d59570606996d7115365244d
---
M sites/all/modules/wmf_common/wmf_civicrm/recurring.inc
1 file changed, 3 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm
refs/changes/39/95739/1
diff --git a/sites/all/modules/wmf_common/wmf_civicrm/recurring.inc
b/sites/all/modules/wmf_common/wmf_civicrm/recurring.inc
index 753063b..7db460d 100644
--- a/sites/all/modules/wmf_common/wmf_civicrm/recurring.inc
+++ b/sites/all/modules/wmf_common/wmf_civicrm/recurring.inc
@@ -270,14 +270,9 @@
// it'll be the wrong value and it'll be in the future; we fix that up
below.
$last_trigger = mktime(0, 0, 0, $month,
wmf_civicrm_get_cycle_day_for_month( $cycle_day, $month, $year ), $year);
- // This loop fixes up $last_trigger in the case where we're running in a
later month than when
- // the last trigger date actually was, which means $last_trigger will be
in the future and will
- // therefore be wrong (instead, it'll be the *next* trigger date). In this
case, we move
- // $last_trigger back a month. The 60*60*24*7 represents a week in
seconds: if the next payment
- // is due in less than a week, do NOT execute it but skip to the next
month instead.
- // TODO this is incredibly confusing, mostly because this logic is in the
wrong place. It
- // should be checked when computing the next payment date, not here where
we're computing the
- // previous (scheduled) payment date.
+ // So... we actually want last month's date... to psych out the code which
+ // will add a month. Note that this is not necessarily the true last
+ // trigger date, just our best-case guess.
while ( $last_trigger > $nowstamp && ( $last_trigger - $nowstamp ) >
60*60*24*7 ){
//decrement the month until it was in the past.
--$month;
--
To view, visit https://gerrit.wikimedia.org/r/95739
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id5fa40ea8d89ccc1d59570606996d7115365244d
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Adamw <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits