diff --git a/lib/classes/JsonApi/Routes/Users/UsersIndex.php b/lib/classes/JsonApi/Routes/Users/UsersIndex.php index c1a4fb7b8e49c1029d8275613af72697fb971224..e7f074a11159e89231fec6511e1fd05c137135b4 100644 --- a/lib/classes/JsonApi/Routes/Users/UsersIndex.php +++ b/lib/classes/JsonApi/Routes/Users/UsersIndex.php @@ -35,8 +35,8 @@ class UsersIndex extends JsonApiController $this->validateFilters(); $filters = $this->getFilters(); - list($offset, $limit) = $this->getOffsetAndLimit(); - $partSQL = \GlobalSearchUsers::getSQL($filters['search'], [], $limit + $offset); + [$offset, $limit] = $this->getOffsetAndLimit(); + $partSQL = \GlobalSearchUsers::getSQL($filters['search'], [], "{$offset}, {$limit}"); $search_result = \DBManager::get()->fetchAll($partSQL); $total = (int) \DBManager::get()->fetchColumn('SELECT FOUND_ROWS() as found_rows'); diff --git a/lib/classes/globalsearch/GlobalSearchUsers.php b/lib/classes/globalsearch/GlobalSearchUsers.php index 458f0982101628d314a9b51726b76908380de077..24952ef16557d62d18946c934c8cc7462bf527b1 100644 --- a/lib/classes/globalsearch/GlobalSearchUsers.php +++ b/lib/classes/globalsearch/GlobalSearchUsers.php @@ -29,6 +29,11 @@ class GlobalSearchUsers extends GlobalSearchModule implements GlobalSearchFullte * @param string $search the input query string * @param array $filter an array with search limiting filter information (e.g. 'category', 'semester', etc.) * @return string SQL Query to discover elements for the search + * + * @todo If the signature of this method changes, the UsersIndex jsonapi + * route must also be taken into account. The route adds another + * parameter so that offset and limit can be used. + * @see \JsonApi\Routes\Users\UsersIndex::__invoke */ public static function getSQL($search, $filter, $limit) {