Skip to content

Commit 3cee36a

Browse files
authored
Merge pull request #32135 from eileenmcnaughton/task_api4
Fix failure to permit actions on deleted contributions (move) - use apiv4
2 parents 96858e3 + 215d225 commit 3cee36a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

CRM/Core/Controller/Task.php

+5-6
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $mod
2929
$id = explode(',', CRM_Utils_Request::retrieve('id', 'CommaSeparatedIntegers', $this, TRUE));
3030

3131
// Check permissions
32-
$perm = civicrm_api3($this->getEntity(), 'get', [
33-
'return' => 'id',
34-
'options' => ['limit' => 0],
35-
'check_permissions' => 1,
36-
'id' => ['IN' => $id],
37-
])['values'];
32+
$perm = (array) civicrm_api4($this->getEntity(), 'get', [
33+
'select' => ['id'],
34+
'checkPermissions' => TRUE,
35+
'where' => [['id', 'IN', $id]],
36+
])->indexBy('id');
3837
if (empty($perm)) {
3938
throw new CRM_Core_Exception(ts('No records available'));
4039
}

0 commit comments

Comments
 (0)