Skip to content

Commit

Permalink
Merge pull request #32135 from eileenmcnaughton/task_api4
Browse files Browse the repository at this point in the history
Fix failure to permit actions on deleted contributions (move) - use apiv4
  • Loading branch information
monishdeb authored Feb 24, 2025
2 parents 96858e3 + 215d225 commit 3cee36a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions CRM/Core/Controller/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $mod
$id = explode(',', CRM_Utils_Request::retrieve('id', 'CommaSeparatedIntegers', $this, TRUE));

// Check permissions
$perm = civicrm_api3($this->getEntity(), 'get', [
'return' => 'id',
'options' => ['limit' => 0],
'check_permissions' => 1,
'id' => ['IN' => $id],
])['values'];
$perm = (array) civicrm_api4($this->getEntity(), 'get', [
'select' => ['id'],
'checkPermissions' => TRUE,
'where' => [['id', 'IN', $id]],
])->indexBy('id');
if (empty($perm)) {
throw new CRM_Core_Exception(ts('No records available'));
}
Expand Down

0 comments on commit 3cee36a

Please sign in to comment.