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 2012-06-29 16:49:09

entr04y
Member
Registered: 2011-05-13
Posts: 18

entity errors

I am running 0.83.2 and as a super admin user with recursive rights to all sub entities I'm running into a problem where If I have the entity set as Root (show all) and list the computer inventory I get the list of computers in the system.  If I change it to any other entity, including Root without the (Show all) selected I get the following sql error, and don't get any computers in the list:

06-29-2012 10:41
*** MySQL query error :
***
SQL: SELECT \'admin\' AS currentuser,
                         `glpi_computers`.`name` AS ITEM_0,
                        `glpi_computers`.`id` AS ITEM_0_2, `glpi_computers`.`date_mod` AS ITEM_1,  COUNT(DISTINCT `glpi_tickets_items_id_7954c3cd898ff2b3a2913a3e8d7fdf82`.`id`) AS ITEM_2,  COUNT(DISTINCT `glpi_items_problems`.`id`) AS ITEM_3, `glpi_computers`.`id` AS id  FROM `glpi_computers` LEFT JOIN `glpi_tickets`  AS glpi_tickets_items_id_7954c3cd898ff2b3a2913a3e8d7fdf82
                                          ON (`glpi_computers`.`id` = `glpi_tickets_items_id_7954c3cd898ff2b3a2913a3e8d7fdf82`.`items_id`
                                              AND `glpi_tickets_items_id_7954c3cd898ff2b3a2913a3e8d7fdf82`.`itemtype` = \'Computer\'
                                              AND ( `glpi_tickets_items_id_7954c3cd898ff2b3a2913a3e8d7fdf82`.`entities_id` IN (\'0\')  )  )  LEFT JOIN `glpi_items_problems`  AS glpi_items_problems_7954c3cd898ff2b3a2913a3e8d7fdf82
                                          ON (`glpi_computers`.`id` = `glpi_items_problems_7954c3cd898ff2b3a2913a3e8d7fdf82`.`items_id`
                                              AND `glpi_items_problems_7954c3cd898ff2b3a2913a3e8d7fdf82`.`itemtype` = \'Computer\'
                                              AND ( `glpi_items_problems_7954c3cd898ff2b3a2913a3e8d7fdf82`.`entities_id` IN (\'0\')  )  )  WHERE  `glpi_computers`.`is_deleted` = \'0\'  AND `glpi_computers`.`is_template` = \'0\'  AND  ( `glpi_computers`.`entities_id` IN (\'0\')  )  GROUP BY `glpi_computers`.`id` ORDER BY ITEM_0 ASC  LIMIT 0, 50
Error: Unknown column 'glpi_items_problems.id' in 'field list'
Backtrace :
/var/www/glpi/inc/search.class.php :752        DBmysql->query()
/var/www/glpi/inc/search.class.php :48        Search::showList()
/var/www/glpi/front/computer.php :43        Search::show()
/var/www/glpi/front/computer.php

Offline

#2 2012-08-10 13:52:11

supcik
Member
Registered: 2012-08-10
Posts: 1

Re: entity errors

I have the same issue and there are actually 2 problems in the query:

1.  The query ask to "COUNT(DISTINCT `glpi_items_problems`.`id`)", but this filed does not exist. It is renamed by "`glpi_items_problems`  AS glpi_items_problems_7954c3cd898ff2b3a2913a3e8d7fdf82"

2. There is no entities_id on the table glpi_items_problems, so this can't work: `glpi_items_problems_7954c3cd898ff2b3a2913a3e8d7fdf82`.`entities_id` IN (\'0\')

By the way, I am using 0.83.4 and the problem is still here!

I was able to solve the problem by asking GLPI to not show the number of problems in the overview. You can do this by clicking on the first header cell (the one marked with a "+") and removing "Number of problems" from the list of items to display by default.

Offline

#3 2012-08-10 17:26:30

remi
GLPI-DEV
From: Champagne
Registered: 2007-04-28
Posts: 7,127
Website

Re: entity errors

I reproduce, ticket open https://forge.indepnet.net/issues/3821
Move this thread to bug section.


Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/

Offline

#4 2012-08-10 17:50:14

remi
GLPI-DEV
From: Champagne
Registered: 2007-04-28
Posts: 7,127
Website

Re: entity errors

Fix proposal https://forge.indepnet.net/projects/glp … ions/19086

Can you test it please ?


Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/

Offline

Board footer

Powered by FluxBB