Contribution tasks receive wrong IDs from contact search
Starting with Civi 5.37, when using Advanced Search with "Display Results As" set to "Contributions" while also using a custom profile for "Views For Display Contacts" (either by selecting it or making it the default in "Search Preferences"), performing any contribution task will use the ID of the custom profile (uf_group_id
) as the contribution ID, effectively doing things to an unrelated contribution that just happens to have the same ID.
This is due to the form storing uf_group_id
in the id
property in the controller, which is later returned as the supposed contribution id in CRM_Contribute_Form_Task_TaskTrait::calculateIDS()
.
The bug was introduced with 06dec048 in https://github.com/civicrm/civicrm-core/pull/19904.
I have a potential fix available here, not sure if it's the right approach.