Amber flagged an issue where she received the error message below and was unable to view the activity for CID 43432239. Michael and Kristie, on the other hand, couldn’t see the activity either, but they did not encounter the error message.
Description
Details
Event Timeline
These seem to be happening on a couple of activity types - one historical & the other being created now - which is probably what we are getting problems from & probably requires a code change
select activity_type_id, MIN(activity_date_time), MAX(activity_date_time), count(*) FROM civicrm_activity WHERE source_record_id = 0 GROUP BY
activity_type_id;
| activity_type_id | MIN(activity_date_time) | MAX(activity_date_time) | count(*) |
| 80 (refund) | 2024-10-09 07:40:02 | 2025-01-13 19:08:02 | 2140 |
| 129 (Event - Fundraising Reception) | 2020-10-28 00:00:00 | 2020-10-28 00:00:00 | 21604 |
This is coming from - why does $parentTxnID = 0 - should we cast it NULL below (ie ->addValue('source_record_id', $parentTxn ?: NULL) - or should we fix it earlier
// add activity to record refund reason (e.g. why do we get chargeback),
// currently only adyen has this field, need to ask gr4vy if they can also pass it back
if (!empty($reason)) {
// Log the refund reason to activity
\Civi\Api4\Activity::create(FALSE)
->addValue('date', $message['date'])
->addValue('activity_type_id:name', 'Refund')
->addValue('subject', ts('Refund Reason'))
->addValue('status_id:name', 'Completed')
->addValue('details', $contributionStatus . ' reason: ' . $message['reason'])
->addValue('source_contact_id', $contributions[0]['contact_id'])
->addValue('target_contact_id', $contributions[0]['contact_id'])
->addValue('source_record_id', $parentTxn)
->execute();
}It looks like in these case the parent_trxn_id was either missing or invalid - perhaps we need to check
Change #1110901 had a related patch set uploaded (by Eileen; author: Eileen):
[wikimedia/fundraising/crm@master] Stop passing 'contributions' when we only want one
Change #1110902 had a related patch set uploaded (by Eileen; author: Eileen):
[wikimedia/fundraising/crm@master] Unpack the contributions to the single one we want earlier
Change #1110904 had a related patch set uploaded (by Eileen; author: Eileen):
[wikimedia/fundraising/crm@master] Fix Refund activity to hold correct value for source_record_id
Change #1110905 had a related patch set uploaded (by Eileen; author: Eileen):
[wikimedia/fundraising/crm@master] Fix data errors on source_record_id
Change #1110950 had a related patch set uploaded (by Eileen; author: Eileen):
[wikimedia/fundraising/crm@master] Standardise Contribution.get calls
Change #1110951 had a related patch set uploaded (by Eileen; author: Eileen):
[wikimedia/fundraising/crm@master] Remove last calls to old drupal module function
Change #1110901 merged by jenkins-bot:
[wikimedia/fundraising/crm@master] Stop passing 'contributions' when we only want one
Change #1110902 merged by jenkins-bot:
[wikimedia/fundraising/crm@master] Unpack the contributions to the single one we want earlier
Change #1110904 merged by jenkins-bot:
[wikimedia/fundraising/crm@master] Fix Refund activity to hold correct value for source_record_id
Change #1110905 merged by jenkins-bot:
[wikimedia/fundraising/crm@master] Fix data errors on source_record_id
Change #1110950 merged by jenkins-bot:
[wikimedia/fundraising/crm@master] Standardise Contribution.get calls
Change #1110951 merged by jenkins-bot:
[wikimedia/fundraising/crm@master] Remove last calls to old drupal module function
@SHust - https://civicrm.wikimedia.org/civicrm/contact/view?reset=1&cid=43432239&selectedChild=activity should be working for everyone now?
I'm happy to confirm that we can see the activities for the CIDs shared here. Thanks a million, @Eileenmcnaughton, for the speedy fix!
Change #1117286 had a related patch set uploaded (by Eileen; author: Eileen):
[wikimedia/fundraising/crm@master] Port upstream activity display fix
Change #1117286 merged by Ejegg:
[wikimedia/fundraising/crm@master] Port upstream activity display fix
