fusioninventory-for-glpi
fusioninventory-for-glpi copied to clipboard
GLPI 9.5.5 + FI 9.5+3.0 / PHP 8 Error on deploy task retreival
Hello,
I spent quite some time figuring what was going on with deploys stuck on prepared since migrating from Linux/Apache to Win/IIS, as a lot could have append along the way.
But after fixing everything on the configuration side, I get a php error :
glpiphplog.CRITICAL: *** Uncaught Exception TypeError: array_key_exists(): Argument #2 ($array) must be of type array, stdClass given in C:\inetpub\glpi\plugins\fusioninventory\b\deploy\index.php at line 126
When looking at the index.php in deploy, it seems the auto-casting from StdClass to array doesn't work for $order->associatedFiles
On line 126, if I explicitly cast, it suddenly all works fine :
if (!array_key_exists($hash, (array) $order->associatedFiles)) {
Here full phpinfo (Php 8.0.3) phpinfo.txt
Sorry I lack time for submitting a proper PullRequest, and unsure if it's a bug in this php version or not... Cheers !
Hello, I have the same issue with the same configuration (GLPI 9.5.5 - FI 9.5+3.0 - php 8.0.9) : GLPI log : glpiphplog.CRITICAL: *** Uncaught Exception TypeError: array_key_exists(): Argument #2 ($array) must be of type array, stdClass given in C:\inetpub\glpi\plugins\fusioninventory\b\deploy\index.php at line 126
FusionInventory agent : [Fri Aug 27 11:13:20 2021][debug] [http server] GET request /status from client 10.194.32.84 [Fri Aug 27 11:13:20 2021][debug] [http server] response status 200 [Fri Aug 27 11:13:20 2021][error] [http client] Got empty response [Fri Aug 27 11:13:20 2021][debug] bad JSON: No answer from server. [Fri Aug 27 11:13:20 2021][info] No Deploy job found in server jobs list.
Thanks Givrix for the correction, it's work fine ;)
Happy it helped!