Page MenuHomePhabricator

Last donation currency not updated when processing recurring donations
Closed, ResolvedPublic

Description

I discovered a bunch of contacts have incorrect wmf_donor data for last_donation_currency

This is set in the Contribution:pre hook so that must be being by-passed - although I have not spotted where...

They seem to be almost all recurring

select original_currency, last_donation_currency, gateway, count(*),SUM(IF(ISNULL(contribution_recur_id),0,1)) as count_recurring,contact_id FROM wmf_contribution_extra e LEFT JOIN civicrm_contribution c ON e.entity_id = c.id LEFT JOIN wmf_donor d ON d.entity_id = c.cont
act_id WHERE receive_date > '2025-09-01' AND original_currency <> last_donation_currency AND receive_date = last_donation_date GROUP BY e.original_curre
+-------------------+------------------------+-----------+----------+-----------------+------------+

original_currencylast_donation_currencygatewaycount(*)count_recurringcontact_id
AUDUSDadyen140291402940894327
AUDUSDgravy71771727078924
AUDUSDpaypal3923924734817
AUDUSDpaypal_ec20418204184893269
BBDUSDadyen1149478785
BGNUSDadyen191968033325
BGNUSDgravy2267739237
BHDUSDadyen11932352
BMDUSDadyen44rOMWC1046398460dc
BOBUSDadyen1153681132
BRLUSDadyen124912493994198
BRLUSDdlocal2159215963372165
BRLUSDgravy88888822189361
BZDUSDadyen1123404724
CADUSDadyen21261212619108511
CADUSDgravy112011201484947
CADUSDpaypal4844846018171
CADUSDpaypal_ec173301733067341374
CHFUSDadyen202060532536
CHFUSDpaypal_ec5551708023
CLPUSDadyen868663386350
CLPUSDdlocal74474451121239
CLPUSDgravy19519520911880
CNYUSDadyen121248565864
COPUSDadyen313144339735
COPUSDdlocal21321363732283
COPUSDgravy696968161731
CRCUSDadyen7759804216
CRCUSDgravy1168025395
CZKUSDadyen6956695626294707
CZKUSDgravy10910940604486
CZKUSDpaypal10101212807
CZKUSDpaypal_ec68268259536379
DKKUSDadyen341734176524559
DKKUSDgravy8668663993597
DKKUSDpaypal8810795246
DKKUSDpaypal_ec1217121731094663
DOPUSDadyen1165163169
EGPUSDadyen2263214520
EURCADbenevity1019947808
EURUSDadyen572285722814594532
EURUSDgravy400640067953159
EURUSDpaypal143014307814385
EURUSDpaypal_ec519835198367717672
GBPEURbenevity3040956573
GBPUSDadyen466174661725224520
GBPUSDgravy2425242544848460
GBPUSDpaypal1679167918936946
GBPUSDpaypal_ec475214752149093214
GTQUSDadyen1164418148
HKDUSDadyen44446319279
HKDUSDgravy2267727989
HKDUSDpaypal33rEPTR2074720fdec8
HKDUSDpaypal_ec282826205568
HNLUSDadyen2263247306
HUFUSDadyen15715759433112
HUFUSDgravy282841476928
HUFUSDpaypal11111286983
HUFUSDpaypal_ec31531520765286
ILSUSDadyen8408407586785
ILSUSDgravy4456444929
ILSUSDpaypal45457079088
ILSUSDpaypal_ec1006100615646735
INRUSDadyen1110864532
JMDUSDadyen1157092020
JODUSDadyen3359936247
JPYUSDadyen240012400134487676
JPYUSDgravy17817867789528
JPYUSDpaypal996683144
JPYUSDpaypal_ec3870387035535811
KESUSDadyen2266596131
KHRUSDadyen1166085369
KZTUSDadyen3359229402
KZTUSDgravy1122937350
LKRUSDadyen4466197825
MADUSDadyen2230469953
MKDUSDadyen1126998538
MXNUSDadyen30330367520074
MXNUSDdlocal1253125359662360
MXNUSDgravy14814868044058
MXNUSDpaypal11821664
MXNUSDpaypal_ec1579157967524316
MYRUSDadyen373373207723
MYRUSDgravy3367965219
NIOUSDadyen1167621256
NOKUSDadyen4308430831188513
NOKUSDgravy69069041611225
NOKUSDpaypal303011372318
NOKUSDpaypal_ec2355235567718291
NZDUSDadyen41094109959337
NZDUSDgravy23423452492224
NZDUSDpaypal1515189321
NZDUSDpaypal_ec1578157839098131
PABUSDadyen4460474248
PENUSDadyen111167525721
PENUSDdlocal606051111949
PENUSDgravy313167539398
PHPUSDadyen661023752
PHPUSDpaypal11255905
PHPUSDpaypal_ec131361752916
PKRUSDadyen4467533903
PKRUSDgravy113417009
PLNUSDadyen23923931929903
PLNUSDgravy9968198202
PLNUSDpaypal31314671981
PLNUSDpaypal_ec332332418835
RONUSDadyen4274273988800
RONUSDgravy121267990494
SEKUSDadyen583358331394049
SEKUSDgravy233323336843892
SEKUSDpaypal1141146417013
SEKUSDpaypal_ec275527553699619
SGDUSDadyen969613028921
SGDUSDgravy8866280489
THBUSDadyen9953187759
THBUSDgravy1110484961
THBUSDpaypal112009426
THBUSDpaypal_ec111167340410
TTDUSDadyen111917872
TWDUSDadyen262660921583
TWDUSDgravy1158726137
TWDUSDpaypal114774453
TWDUSDpaypal_ec101010243526
USDAUDgravy1308509266
USDCADgravy14162210011
USDGBPgravy1619695875
UYUUSDadyen676763732368
UYUUSDdlocal24924963735602
UYUUSDgravy727220659147
XCDUSDadyen2247594149
ZARUSDadyen20720741833019
ZARUSDdlocal4434437585794
ZARUSDgravy515167830186

Details

Event Timeline

AKanji-WMF moved this task from Triage to Chaos Crew Backlog on the Fundraising-Backlog board.

Having looked at this, I can see the last discrepancy for contributions from the Recurring flow was in October (2025-10-28 12:10:01) and for Direct payment wiki flow was back in September (2025-09-10 16:39:19). I also attempted some test transactions on my profile (one time and recurring charge) and I noticed the last contribution currency was updated on the contact record. Perhaps this might have fixed itself for the DonationQueueConsumer flow.

However, I noticed 5 recent Major Gift imported transactions on this cid 31398010 with the discrepancies.

Change #1217217 had a related patch set uploaded (by Damilare Adedoyin; author: Damilare Adedoyin):

[wikimedia/fundraising/crm@master] Set Citi to calculated data exclude list

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

Change #1217217 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Set Citi to calculated data exclude list

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

XenoRyet set Final Story Points to 2.