You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2015-03-23 20:21:47

kabassanov
Member
Registered: 2009-10-06
Posts: 44

SQL Error While Retrieving Users in Watchers' List

Hi,

In GLIP 0.85.2, when  users create a new ticket from the post-only simplified interface, the dropdown watcher list does not diplay any name due to an SQL error:

2015-03-23 19:15:30 [7753@toto.titi.fr]
  *** MySQL query error:
  SQL: SELECT DISTINCT `glpi_users`.*
                   FROM `glpi_users`  LEFT JOIN `glpi_useremails`
                     ON (`glpi_users`.`id` = `glpi_useremails`.`users_id`)
                  LEFT JOIN `glpi_profiles_users`
                     ON (`glpi_users`.`id` = `glpi_profiles_users`.`users_id`) WHERE  `glpi_users`.`id` IN (,7294,7299) AND `glpi_users`.`is_deleted` = \'0\'
                  AND `glpi_users`.`is_active` = \'1\'
                  AND (`glpi_users`.`begin_date` IS NULL
                       OR `glpi_users`.`begin_date` < NOW())
                  AND (`glpi_users`.`end_date` IS NULL
                       OR `glpi_users`.`end_date` > NOW())  ORDER BY `glpi_users`.`firstname`,
                               `glpi_users`.`realname`,
                               `glpi_users`.`name`  LIMIT 0,100
  Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '7294,7299' at line 5
  Backtrace :
  inc/user.class.php:3097
  ajax/getDropdownUsers.php:82                       User::getSqlSearchResult()

The error comes from the starting "," in the IN clause.

Sometimes, the issue is still in the IN clause, but between 2 numbers, it looks like an empty value has been inserted into the list used for the sql query creation.

Thanks.

Offline

#2 2015-03-27 20:26:41

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,278

Re: SQL Error While Retrieving Users in Watchers' List

Il n'y aurait pas un utilisateur qui soit dans un groupe mais qui n'ai plus aucun droit ?
Dans ce cas il sera dans la corbeille des utilisateurs de l'entité racine.


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#3 2015-04-10 13:28:35

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,278

Re: SQL Error While Retrieving Users in Watchers' List

Problem was in your DB (manually action).
I close (ask from IRC)


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

Board footer

Powered by FluxBB