Page MenuHomePhabricator

Endowment donation not showing in Last Donated in CiviCRM contact pop-up
Closed, ResolvedPublic

Description

Event Timeline

@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

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

@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.

This is now ready for review again as we can do this now.

Change #1208460 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Backfill all_funds last and first donation dates for older endowment donations

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

@krobinson This has been fixed, all contacts should now show all funds last (and first) donation date.

XenoRyet set Final Story Points to 2.