You are not logged in.
I recently upgraded my GLPI instance to .85, and I upgraded the webapplications plugin accordingly. I can access the web applications page itself, but the web applications tab on the computers just says "loading." my sql-errors log shows:
2015-01-16 11:20:50 [6@hostname]
*** MySQL query error:
SQL: SELECT *
FROM `glpi_plugin_webapplications_webapplicationtypes`
WHERE `id` IN (SELECT DISTINCT `plugin_webapplications_webapplicationtypes_id`
FROM `glpi_plugin_webapplications_webapplications`
WHERE `glpi_plugin_webapplications_webapplications`.`is_deleted` = \'0\' AND ( `glpi_plugin_webapplications_webapplications`.`entities_id` = \'0\' ) AND `id` NOT IN (0, ,5,2,8))
ORDER BY `name`
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 '5,2,8))
ORDER BY `name`' at line 5
Backtrace :
...ebapplications/inc/webapplication.class.php:388
...lications/inc/webapplication_item.class.php:451 PluginWebapplicationsWebapplication::dropdown()
...plications/inc/webapplication_item.class.php:86 PluginWebapplicationsWebapplication_Item::showForItem()
inc/commonglpi.class.php:455 PluginWebapplicationsWebapplication_Item::displayTabContentForItem()
ajax/common.tabs.php:87 CommonGLPI::displayStandardTab()
I don't know php very well at all, but from looking at the plugin code, I'm guessing this list of "NOT IN" Id's is supposed to be a list of webapplication IDs that belong to the computer whose record I am viewing. In this particular instance (although this is a problem with all computers that have associated webapplications), web applications 5, 2, and 8 are the only web applications associated with that computer, meaning that it looks like there's an extra entry in that list, rather than a space where a number should be.
I may be way off base here, but I was able to get the tab to load by editing the following code in plugins/webapplications/inc/webapplication.class.php:
$where = " WHERE `glpi_plugin_webapplications_webapplications`.`is_deleted` = '0' ".
getEntitiesRestrictRequest("AND", "glpi_plugin_webapplications_webapplications", '', $p['entity'], true);
if (count($p['used'])) {
$where .= " AND `id` NOT IN (0, ".implode(",",$p['used']).")";
}
Removing the comma between the 0 and the ".implode" makes the tab load, but the first entry in the list seems to be an invalid entry, so obviously that's not the correct thing to do. Any advice?
Offline
Ticket open on the roadmap of the plugin: https://forge.indepnet.net/issues/5192
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
Can you add an $p['used'] = array_filter($p['used']);
$where = " WHERE `glpi_plugin_webapplications_webapplications`.`is_deleted` = '0' ".
getEntitiesRestrictRequest("AND", "glpi_plugin_webapplications_webapplications", '', $p['entity'], true);
$p['used'] = array_filter($p['used']);
if (count($p['used'])) {
$where .= " AND `id` NOT IN (0, ".implode(",",$p['used']).")";
}
for test ?
Xavier Caillaud
Blog GLPI Infotel
Offline
Adding that line makes the tab load, but it still has that odd first entry. The name (with no underlying link) shows up as "N/A", and the URL shows up as "..." with a link to that computer's GLPI page (that is, the page I'm on).
Offline