Sample CID: 50126943
See previous similar issue T346917: Endowment donation not showing up in the pop-up when mousing over the Civi icon
Sample CID: 50126943
See previous similar issue T346917: Endowment donation not showing up in the pop-up when mousing over the Civi icon
@krobinson After taking a look at this, it looks like these dates have been filled correctly for any donor who has given since Sept 28, 2021 — but for any donor who has only given an endowment gift and only given before that date, this value (All funds last donation date, as well as the closely related All funds first donation date) has not been filled in. Since there are 650k contacts who meet these criteria, I think it does make sense for us to backfill this data.
To select:
SELECT `a`.`id` AS `id`, `Contact_Contribution_contact_id_01`.`receive_date` AS `Contact_Contribution_contact_id_01.receive_date`, `Contact_Contribution_contact_id_01`.`financial_type_id` AS `Contact_Contribution_contact_id_01.financial_type_id:label`, `wmf_donor_1`.`all_funds_last_donation_date` AS `wmf_donor.all_funds_last_donation_date`, `Contact_Contribution_contact_id_01`.`id` AS `Contact_Contribution_contact_id_01.id` FROM `civicrm_contact` a INNER JOIN (`civicrm_contribution` `Contact_Contribution_contact_id_01`) ON `a`.`id` = `Contact_Contribution_contact_id_01`.`contact_id` AND `Contact_Contribution_contact_id_01`.`contribution_status_id` = "1" AND `Contact_Contribution_contact_id_01`.`financial_type_id` = "26" LEFT JOIN wmf_donor `wmf_donor_1` ON `a`.`id` = `wmf_donor_1`.`entity_id` WHERE (`wmf_donor_1`.`all_funds_last_donation_date` IS NULL) AND (`a`.`is_deleted` = "0")
Change #1208460 had a related patch set uploaded (by Lars SG; author: Lars SG):
[wikimedia/fundraising/crm@master] Backfill all_funds last and first donation dates for older endowment donations
@krobinson Since this takes ~10 minutes to run, we've decided to put it off until next year to avoid slowing anything down. The backfill is ready to go, so we'll just revive it then.
Change #1208460 merged by jenkins-bot:
[wikimedia/fundraising/crm@master] Backfill all_funds last and first donation dates for older endowment donations
@krobinson This has been fixed, all contacts should now show all funds last (and first) donation date.