You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2022-06-27 11:25:17

bmichelsz
Member
From: Slovakia
Registered: 2007-10-20
Posts: 37

Uncaught Exception Error - [] operator not supported for string

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

#2 2022-06-27 16:16:45

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,813
Website

Re: Uncaught Exception Error - [] operator not supported for string

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

#3 2022-06-28 12:11:20

bmichelsz
Member
From: Slovakia
Registered: 2007-10-20
Posts: 37

Re: Uncaught Exception Error - [] operator not supported for string

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

Board footer

Powered by FluxBB