Skip to content

Commit

Permalink
dev/core#2739 - Fix contribution tasks using wrong IDs
Browse files Browse the repository at this point in the history
This fixes an issue where contribution tasks may perform actions
on unrelated contribution IDs when they're called via contact
search forms.
  • Loading branch information
pfigel committed Aug 4, 2021
1 parent 51e58f8 commit 6645ca8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CRM/Contribute/Form/Task/TaskTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ public function getIDs() {
* @throws \CRM_Core_Exception
*/
protected function calculateIDS() {
if ($this->controller->get('id')) {
// contact search forms use the id property to store the selected uf_group_id
// rather than entity (contribution) IDs, so don't use the property in that case
if (!$this->controller instanceof CRM_Contact_Controller_Search && $this->controller->get('id')) {
return explode(',', $this->controller->get('id'));
}
$ids = $this->getSelectedIDs($this->getSearchFormValues());
Expand Down

0 comments on commit 6645ca8

Please sign in to comment.