fix: [permissionLimitation:getListOfLimitations] Fixed DatabaseException for condition with empty list of values

pull/184/head
Sami Mokaddem 2024-09-24 14:17:00 +02:00
parent 1837c4259e
commit 1c93a71f80
1 changed files with 8 additions and 5 deletions

View File

@ -67,12 +67,15 @@ class PermissionLimitationsTable extends AppTable
]
])->all()->toList();
if (isset($data['global'])) {
$limitations[$field]['global']['current'] = $MetaFields->find('all', [
'conditions' => [
$conditions = [
'scope' => 'user',
'field' => $field,
'parent_id NOT IN' => $disabledUserIds
]
];
if (!empty($disabledUserIds)) {
$conditions['parent_id NOT IN'] = $disabledUserIds;
}
$limitations[$field]['global']['current'] = $MetaFields->find('all', [
'conditions' => $conditions,
])->count();
}
if (isset($data['global'])) {