You are not logged in.
Hello all,
after upgrade to version 10.0.1 a Business Rules for Ticket stopped working. After ticket creation/update a white screen appear and in php-errors.log file, the following error is reported:
[2022-06-27 10:30:04] glpiphplog.CRITICAL: *** Uncaught Exception Error: [] operator not supported for strings in /var/www/htdocs/GLPI_ROOT/src/RuleTicketCollection.php at line 148
Backtrace :
src/RuleCollection.php:1760 RuleTicketCollection->prepareInputDataForProcess()
src/RuleCollection.php:1601 RuleCollection->prepareInputDataForProcessWithPlugins()
src/Ticket.php:1240 RuleCollection->processAllRules()
src/CommonDBTM.php:1565 Ticket->prepareInputForUpdate()
front/ticket.form.php:84 CommonDBTM->update()
I mitigated this error witch code change in RuleTicketCollection.php file on line 148 from
$input[$input_key][] = $actor['items_id'];
to
$input[$input_key] = $actor['items_id'];
Of course, a Business rules still don't work, but at least the white screen isn't showing. In php-errors.log file, a warning is reported instead of error:
[2022-06-27 10:38:12] glpiphplog.WARNING: *** PHP Warning (2): in_array() expects parameter 2 to be array, string given in /var/www/htdocs/GLPI_ROOT/src/RuleTicketCollection.php at line 144
Backtrace :
src/RuleTicketCollection.php:144 in_array()
src/RuleCollection.php:1760 RuleTicketCollection->prepareInputDataForProcess()
src/RuleCollection.php:1601 RuleCollection->prepareInputDataForProcessWithPlugins()
src/Ticket.php:1240 RuleCollection->processAllRules()
src/CommonDBTM.php:1565 Ticket->prepareInputForUpdate()
front/ticket.form.php:84 CommonDBTM->update()
Maybe this problem is related to https://github.com/glpi-project/glpi/issues/11918 or https://github.com/glpi-project/glpi/pull/11957
Any help is welcome.
Thank you.
Debian 11, GLPI 10.0.6, OCS 2.3.1, MariaDB 10.5.18, Apache 2.4.52, PHP 7.4.33
Offline
I am fairly sure that the issue is indeed caused by the known issue with actor handling.
The fix in PR 11957 was merged recently so it will be included with 10.0.2, but it could also be applied separately using the "patch" utility if you use Linux.
You can get the patch file by adding ".patch" to the PR URL.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Thank you for reply.
Oh, more than 5000 lines of patch file?
I will rather wait for next release. I hope it will be soon.
Debian 11, GLPI 10.0.6, OCS 2.3.1, MariaDB 10.5.18, Apache 2.4.52, PHP 7.4.33
Offline