Glpi: REST API : empty array when requestiong all users

Created on 22 Sep 2016  路  2Comments  路  Source: glpi-project/glpi

Hi

A request for all users returns an empty JSON no matter there are readable users in the current entity

http://example.org/glpi/users/

200 OK
[]

An SQL error is occured

  *** MySQL query error:
  SQL: SELECT SQL_CALC_FOUND_ROWS DISTINCT `glpi_users`.id,  `glpi_users`.*
                FROM `glpi_users`
                 LEFT JOIN `glpi_profiles_users` 
                                             ON (`glpi_users`.`id` = `glpi_profiles_users`.`users_id`
                                                 )
                WHERE 1=1  ( `glpi_profiles_users`.`entities_id` IN (\'1\')  OR (`glpi_profiles_users`.`is_recursive`=\'1\' AND `glpi_profiles_users`.`entities_id` IN (\'0\')) ) 
                ORDER BY id ASC
                LIMIT 0, 51
  Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '( `glpi_profiles_users`.`entities_id` IN ('1')  OR (`glpi_profiles_users`.`is_re' at line 6
  Backtrace :
  inc/api.class.php:915                              
  inc/apirest.class.php:203                          API->getItems()
  apirest.php:47                                     APIRest->call()

A boolean operator is missing in the beginning of the WHERE clause

RC feedback bug

All 2 comments

fix proposal #1029

Merged

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Aijt picture Aijt  路  6Comments

dbegit picture dbegit  路  7Comments

pVesian picture pVesian  路  6Comments

iaanpermana picture iaanpermana  路  4Comments

trasher picture trasher  路  5Comments