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 2018-02-14 19:00:02

bugless
Member
Registered: 2010-01-24
Posts: 37

[Plugin glpi-reports 1.11.1] 2 bugs

In the listofequipmentbylocation.php report there's this fragment:

$query = getSqlSubRequest("Computer",$loc,new Computer());
foreach($CFG_GLPI["infocom_types"] as $itemtype) {
   $obj = new $itemtype;
   if ($obj->isField('locations_id')) {
      $query.= "UNION (".getSqlSubRequest($itemtype,$loc,$obj).")";
   }
}

I noticed that getSqlSubRequest function is repeating itself *twice* for one same itemtype, Computer: first one being the very first function instance -before any UNION clause-, and the other one during the infocom_types loop that walks thorugh all itemtypes, including Computer itself again.
This seems to have no effect in the actual report displaying, but wouldn't it represent an unnecessary redundancy in the sql query?

Just in case, I made a workaround, or possible "fix":

$query = getSqlSubRequest("Computer",$loc,new Computer());
foreach($CFG_GLPI["infocom_types"] as $itemtype) {
   $obj = new $itemtype;
   if ($obj->isField('locations_id')) {
      if ($itemtype != "Computer") {
         $query.= " UNION (".getSqlSubRequest($itemtype,$loc,$obj).")";
      }
   }
}

Other bug, I noticed this very same old one http://forum.glpi-project.org/viewtopic … 47#p171747 stills there. Where exactly was it "fixed"? It is not fixed neither in current glpi release itself nor in github.

Offline

#2 2018-03-12 19:21:47

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

Re: [Plugin glpi-reports 1.11.1] 2 bugs


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 2018-03-12 19:29:50

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

Re: [Plugin glpi-reports 1.11.1] 2 bugs

Corrected.
You will have the corrected version tomorrow in the tarball: https://forge.glpi-project.org/tarballs-plugins/


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

#4 2018-03-16 18:23:38

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

Re: [Plugin glpi-reports 1.11.1] 2 bugs

Version 1.11.2 published this day


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