From 037a6eb0bd51c67c44de76602694113d5f4b71e5 Mon Sep 17 00:00:00 2001 From: Damien <damien.burel@maarch.org> Date: Tue, 22 Oct 2019 11:26:49 +0200 Subject: [PATCH] FIX #12070 TIME 0:05 Fix usergroups --- src/app/user/models/UserGroupModel.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/user/models/UserGroupModel.php b/src/app/user/models/UserGroupModel.php index ba2398fbf43..79fd6d4af70 100644 --- a/src/app/user/models/UserGroupModel.php +++ b/src/app/user/models/UserGroupModel.php @@ -24,16 +24,16 @@ class UserGroupModel ValidatorModel::arrayType($args, ['select', 'where', 'data', 'orderBy']); ValidatorModel::intType($args, ['limit']); - $fields = DatabaseModel::select([ - 'select' => empty($args['select']) ? ['*'] : $args['select'], + $usersGroups = DatabaseModel::select([ + 'select' => $args['select'] ?? ['*'], 'table' => ['usergroup_content'], - 'where' => empty($args['where']) ? [] : $args['where'], - 'data' => empty($args['data']) ? [] : $args['data'], - 'order_by' => empty($args['orderBy']) ? ['label'] : $args['orderBy'], - 'limit' => empty($args['limit']) ? 0 : $args['limit'] + 'where' => $args['where'] ?? [], + 'data' => $args['data'] ?? [], + 'order_by' => $args['orderBy'] ?? [], + 'limit' => $args['limit'] ?? 0 ]); - return $fields; + return $usersGroups; } public static function update(array $args) -- GitLab