You are not logged in.
Pages: 1
Topic closed
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
Tickets opened on the plugin: https://forge.glpi-project.org/issues/5554 and https://forge.glpi-project.org/issues/5555
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
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
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
Pages: 1
Topic closed