From 549525ab66fe1914fa1aec3089dd8ed8bcdd9dc9 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Mon, 6 Mar 2017 15:48:26 -0500 Subject: [PATCH] Fix regression causing UserModel error. Fixes #265 This commit fixes a regression introduced in b44c9ab (Add parameters to fix the MIDAS API display) --- core/controllers/components/ApiuserComponent.php | 9 ++++++++- core/models/pdo/UserModel.php | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/core/controllers/components/ApiuserComponent.php b/core/controllers/components/ApiuserComponent.php index 21effc5b3..ff3763edf 100644 --- a/core/controllers/components/ApiuserComponent.php +++ b/core/controllers/components/ApiuserComponent.php @@ -63,7 +63,14 @@ public function userList($args) /** @var UserModel $userModel */ $userModel = MidasLoader::loadModel('User'); - return $userModel->getAll(true, $args['limit'], array('firstname','lastname','company','website')); + return $userModel->getAll( + /* $onlyPublic = */ true, + /* $limit = */ $args['limit'], + /* $order = */ 'lastname', + /* $offset = */ null, + /* $currentUser = */ null, + /* $fields = */ array('firstname','lastname','company','website') + ); } /** diff --git a/core/models/pdo/UserModel.php b/core/models/pdo/UserModel.php index f2ec40414..903519335 100644 --- a/core/models/pdo/UserModel.php +++ b/core/models/pdo/UserModel.php @@ -103,7 +103,7 @@ public function getUserCommunities($userDao) } /** Get all */ - public function getAll($onlyPublic = false, $limit = 20, $fields = array('*'), $order = 'lastname', $offset = null, $currentUser = null) + public function getAll($onlyPublic = false, $limit = 20, $order = 'lastname', $offset = null, $currentUser = null, $fields = array('*')) { $sql = $this->database->select(); $sql->from("user", $fields);