glpi-project / glpi-inventory-plugin

GLPI Inventory plugin
GNU Affero General Public License v3.0
46 stars 27 forks source link

fix: PHP Warning - invalid item #485

Closed Rom1-B closed 6 months ago

Rom1-B commented 6 months ago

Cleans a job of obsolete agents.

glpiphplog.WARNING:   *** PHP User Warning (512): Invalid item "Agent" (4418). in /var/www/glpi/marketplace/glpiinventory/inc/taskview.class.php at line 998
  Backtrace :
  ...tplace/glpiinventory/inc/taskview.class.php:998 trigger_error()
  ...tplace/glpiinventory/inc/taskview.class.php:832 PluginGlpiinventoryTaskView->getAgentsFromActors()
  marketplace/glpiinventory/inc/task.class.php:635   PluginGlpiinventoryTaskView->prepareTaskjobs()
  src/CronTask.php:1035                              PluginGlpiinventoryTask::cronTaskscheduler()
  front/cron.php:87                                  CronTask::launch()

ref !31372

trasher commented 6 months ago

I guess this need a unit test.

stonebuzz commented 6 months ago

cleaning up the targets list seems like a good idea, wouldn't it be a good idea not to display the error_log if the clean was done silently?