Open lufik opened 7 years ago
For a now I used quick&dirty fix in plugins/fusioninventory/inc/collect.class.php in function getSearchOptionsToAdd(): I put the body from (inclusive): $pfCollect = new PluginFusioninventoryCollect(); to (without this line): return $tab; into: if (isset($_SESSION['glpiactiveentities_string'])) { }
This stops to report above errors without functional change.
Hi,
I just upgraded to: GLPI: 9.1.2 FusionInventory: 9.1.1.1
Every time the cronCleanoldagents automatic action runs it logs
to php-errors.log: 2017-01-23 17:17:01 [@glpi] *** PHP Notice(8): Undefined index: glpiactiveentities_string Backtrace : inc/db.function.php:1714
plugins/fusioninventory/inc/collect.class.php:131 getEntitiesRestrictRequest() plugins/fusioninventory/hook.php:264 PluginFusioninventoryCollect::getSearchOptionsToAdd() inc/plugin.class.php:1287 plugin_fusioninventory_getAddSearchOptions() inc/search.class.php:5445 Plugin::getAddSearchOptions() inc/log.class.php:124 Search::getOptions() inc/commondbtm.class.php:381 Log::constructHistory() inc/commondbtm.class.php:1146 CommonDBTM->updateInDB() plugins/fusioninventory/inc/agent.class.php:1220 CommonDBTM->update() : PluginFusioninventoryAgent::cronCleanoldagents() inc/crontask.class.php:832 call_user_func() front/cron.php:88 CronTask::launch()
to sql-errors.log: 2017-01-23 17:17:01 [@glpi] ** MySQL query error: SQL: SELECT FROM
glpi_plugin_fusioninventory_collects
WHERE (glpi_plugin_fusioninventory_collects
.entities_id
IN () ) 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 ') )' at line 2 Backtrace : inc/commondbtm.class.php:263plugins/fusioninventory/inc/collect.class.php:131 CommonDBTM->find() plugins/fusioninventory/hook.php:264 PluginFusioninventoryCollect::getSearchOptionsToAdd() inc/plugin.class.php:1287 plugin_fusioninventory_getAddSearchOptions() inc/search.class.php:5445 Plugin::getAddSearchOptions() inc/log.class.php:124 Search::getOptions() inc/commondbtm.class.php:381 Log::constructHistory() inc/commondbtm.class.php:1146 CommonDBTM->updateInDB() plugins/fusioninventory/inc/agent.class.php:1220 CommonDBTM->update() : PluginFusioninventoryAgent::cronCleanoldagents() inc/crontask.class.php:832 call_user_func() front/cron.php:88 CronTask::launch()
I see in plugins/fusioninventory/inc/collect.class.php on line 131 it calls getEntitiesRestrictRequest without a value so the db function expects value in $_SESSION['glpiactiveentities_string']. But as far as it is cron it has no session. I expect it's not high priority to fix it (no change in main behaviour except logging above errors).