Page MenuHomePhabricator

Transactions missing contribution_tracking_id
Closed, ResolvedPublic

Description

ct id would have been:
237251505
236464646

SELECT receive_date, trxn_id FROM civicrm_value_1_gift_data_7 gift INNER JOIN civicrm_contribution c ON c.id = gift.entity_id WHERE channel = '' ORDER BY c.id DESC LIMIT 100;
+---------------------+---------------------------------------------------------------------------------+

receive_datetrxn_id
2025-09-24 15:40:00GRAVY b9e97347-db8a-4214-84b1-59f038e90663
2025-10-22 17:26:00GRAVY f37a91c4-dc88-49e9-bf81-1152fa4c9adc
2025-10-15 16:46:00GRAVY 78c4d244-3fa0-4b7f-8bb0-3a6220603cd0
2025-10-20 16:44:00GRAVY 16f83d63-e2d2-4c2f-8fd9-9f2c2095eaba
2025-10-15 16:41:00GRAVY 09550df0-8723-41da-8547-4c86919894c7
2025-10-15 16:36:00053d3b72-470e-495c-a05b-754386430c19,GRAVY 053d3b72-470e-495c-a05b-754386430c19
2025-10-17 16:32:00073c0b2a-5bec-4b7f-a391-8e7d767659b4,GRAVY 073c0b2a-5bec-4b7f-a391-8e7d767659b4
2025-10-08 19:48:00GRAVY 33075a67-4de7-4126-9dce-bc1a571b06e6
2025-10-06 12:46:00GRAVY fa84365b-5d64-4768-b01b-972fb27ab4e1
2025-10-01 03:07:00GRAVY 3a81a9b1-a398-40d9-bf14-ff50a51127e4
2025-09-30 02:09:00GRAVY 534598d3-29ce-48a5-8430-9ee1a9a9427d
2025-05-13 17:18:00Gravy d7d408f6-94e7-4f41-85d4-88c5a58556ab
2025-09-29 14:16:00GRAVY 48da8f27-a536-40f2-91c2-391c4bb42953
2025-09-29 01:52:00GRAVY 6e48f93e-62a5-4dc0-9e1f-d172a13b623d
2025-09-28 22:41:00PAYPAL_EC 60A70910SG2101912
2025-09-16 22:28:00cb9dba66-ca05-45a9-909f-428ae05748c8
2025-09-01 19:15:00GRAVY ab027555-0c90-458c-b5ff-9ded80f07fbf

This query is doing an OK job of finding them - some where the contribution_tracking has an alternate contribution ...

SELECT 
    c.receive_date,
    c.id,
    c.contact_id,
    t2.contribution_id AS matched_contribution_id,
    gift.channel,
    x.gateway,
    c.invoice_id,
    c.trxn_id
FROM civicrm_value_1_gift_data_7 gift
INNER JOIN civicrm_contribution c 
    ON c.id = gift.entity_id
LEFT JOIN civicrm.wmf_contribution_extra x 
    ON c.id = x.entity_id
LEFT JOIN civicrm_contribution_tracking t 
    ON t.contribution_id = c.id
LEFT JOIN civicrm_contribution_tracking t2
    ON t2.id = CAST(SUBSTRING_INDEX(c.invoice_id, '.', 1) AS UNSIGNED)
    AND c.invoice_id REGEXP '^[0-9]+(\\.|$)'
WHERE 
    c.trxn_id IS NOT NULL
    AND t.id IS NULL
    AND c.trxn_id NOT LIKE 'bene%'
    AND c.trxn_id NOT LIKE 'engag%'
    AND c.trxn_id NOT LIKE 'recur%'
    AND c.trxn_id NOT LIKE 'fidel%'
    AND c.trxn_id NOT LIKE 'match%'
    AND c.trxn_id NOT LIKE 'rfd%'
    AND c.trxn_id NOT LIKE 'ADYEN Transaction Fees%'
    AND (x.gateway IS NULL OR x.gateway NOT LIKE 'enga%')
    AND (gift.channel IS NULL OR gift.channel NOT IN ('Other Offline', 'Recurring Gift'))
ORDER BY c.id DESC
LIMIT 10;

Event Timeline

Cstone renamed this task from Gravy transactions missing contribution_tracking_id to Transactions missing contribution_tracking_id.Nov 5 2025, 12:25 AM
Cstone updated the task description. (Show Details)

At least a few of these are manually entered

b9e97347-db8a-4214-84b1-59f038e90663
16f83d63-e2d2-4c2f-8fd9-9f2c2095eaba

The following query suggests that a bunch of these actually DO have contribution tracking IDs, and the rest are manually entered (nulls in all the source_ fields)

select c.id, t.id as ctid, trxn_id, source_name, source_type, source_host
from civicrm_contribution c
left join wmf_contribution_extra x on x.entity_id=c.id
left join civicrm_contribution_tracking t on t.contribution_id = c.id
where trxn_id in ('GRAVY 78c4d244-3fa0-4b7f-8bb0-3a6220603cd0', 'GRAVY 16f83d63-e2d2-4c2f-8fd9-9f2c2095eaba', 'GRAVY 09550df0-8723-41da-8547-4c86919894c7', 'GRAVY 053d3b72-470e-495c-a05b-754386430c19', 'GRAVY 073c0b2a-5bec-4b7f-a391-8e7d767659b4', 'GRAVY 33075a67-4de7-4126-9dce-bc1a571b06e6', 'GRAVY fa84365b-5d64-4768-b01b-972fb27ab4e1', 'GRAVY 3a81a9b1-a398-40d9-bf14-ff50a51127e4', 'GRAVY 534598d3-29ce-48a5-8430-9ee1a9a9427d', 'Gravy d7d408f6-94e7-4f41-85d4-88c5a58556ab', 'GRAVY 48da8f27-a536-40f2-91c2-391c4bb42953', 'GRAVY 6e48f93e-62a5-4dc0-9e1f-d172a13b623d', 'PAYPAL_EC 60A70910SG2101912', 'GRAVY ab027555-0c90-458c-b5ff-9ded80f07fbf');
idctidtrxn_idsource_namesource_typesource_host
132514807238580924GRAVY 053d3b72-470e-495c-a05b-754386430c19adyen Recon Auditorauditcivi1002
132562877238724416GRAVY 073c0b2a-5bec-4b7f-a391-8e7d767659b4adyen Recon Auditorauditcivi1002
132342149NULLGRAVY 09550df0-8723-41da-8547-4c86919894c7NULLNULLNULL
132342410NULLGRAVY 16f83d63-e2d2-4c2f-8fd9-9f2c2095eabaNULLNULLNULL
131399820237634858GRAVY 33075a67-4de7-4126-9dce-bc1a571b06e6SmashPigjob-runnercivi1002
130888076236873360GRAVY 3a81a9b1-a398-40d9-bf14-ff50a51127e4SmashPigjob-runnercivi1002
130776923236692974GRAVY 48da8f27-a536-40f2-91c2-391c4bb42953SmashPigjob-runnercivi1002
130810056236755100GRAVY 534598d3-29ce-48a5-8430-9ee1a9a9427dSmashPigjob-runnercivi1002
130743615236654710GRAVY 6e48f93e-62a5-4dc0-9e1f-d172a13b623dSmashPigjob-runnercivi1002
132342641NULLGRAVY 78c4d244-3fa0-4b7f-8bb0-3a6220603cd0NULLNULLNULL
130644875NULLGRAVY ab027555-0c90-458c-b5ff-9ded80f07fbfNULLNULLNULL
130794130NULLGravy d7d408f6-94e7-4f41-85d4-88c5a58556abNULLNULLNULL
131258028237386796GRAVY fa84365b-5d64-4768-b01b-972fb27ab4e1SmashPigjob-runnercivi1002
130740909236645493PAYPAL_EC 60A70910SG2101912DonationInterfacepaymentspayments1006
XenoRyet set Final Story Points to 1.