You are not logged in.
Hi.
GLPI: 10.0.7
Formcreator: 2.13.5
I tried to edit the existing form - an error occurred. I tried to add a new form - there is also an error. When I add a new question and select the type e.g. checkboxes, multiselect:
PHP Warning (2): Invalid argument supplied for foreach() in /var/www/html/glpi/marketplace/formcreator/inc/field/checkboxesfield.class.php at line 55
https://github.com/pluginsGLPI/formcreator/issues/3251
Last edited by WebGreg (2023-04-12 17:27:45)
--
GLPI 10.0.17
GLPI-Inventory 1.4.0
Ubuntu Server 20.04 LTS
Offline
Hi
Please provide the complete backtrace for this error. You will find it in glpi/files/_logs/php-errors.log.
Check also if there is a related error in sql-errors.log (same directrory).
No support with MP - Always run an upgrade task on a testing instance before running it on production! Always backup before any upgrade task!
Offline
From what I see in the code, it is possible that a question of type checkboxes contains an inconsistency. Identify the impacted form and question. Check in this question if the list of values is correct.
No support with MP - Always run an upgrade task on a testing instance before running it on production! Always backup before any upgrade task!
Offline
Hi @btry
I don't really have anything to check: new form > new question > change type - error right away.
[2023-04-12 14:10:29] glpiphplog.WARNING: *** PHP Warning (2): Invalid argument supplied for foreach() in /var/www/html/glpi/marketplace/formcreator/inc/field/checkboxesfield.class.php at line 55
Backtrace :
marketplace/formcreator/inc/question.class.php:744 GlpiPlugin\Formcreator\Field\CheckboxesField->showForm()
...etplace/formcreator/ajax/question_design.php:73 PluginFormcreatorQuestion->showForm()
public/index.php:73 require()
I didn't add before - the error doesn't show when debug mode is not running. So it can be overlooked.
Last edited by WebGreg (2023-04-12 14:17:37)
--
GLPI 10.0.17
GLPI-Inventory 1.4.0
Ubuntu Server 20.04 LTS
Offline
Please identify the ID of the question then check in the database the column default_values. Show its content. The table which contains the questions is glpi_plugin_formcreator_questions
No support with MP - Always run an upgrade task on a testing instance before running it on production! Always backup before any upgrade task!
Offline
Please identify the ID of the question then check in the database the column default_values. Show its content. The table which contains the questions is glpi_plugin_formcreator_questions
Default values column: []
I have this value in the column for questions added earlier, before the update. And in a completely new form, in a new question - created after the update.
85;checkboxes;0;0;[];["test1","test2"]
Last edited by WebGreg (2023-04-12 14:39:33)
--
GLPI 10.0.17
GLPI-Inventory 1.4.0
Ubuntu Server 20.04 LTS
Offline
This value is correct : it means that there is no pre-checked items when you show the form containing this question. This bug should not occur with this string...
I need to see if I reproduce
No support with MP - Always run an upgrade task on a testing instance before running it on production! Always backup before any upgrade task!
Offline
Do you want a github ticket for this?
--
GLPI 10.0.17
GLPI-Inventory 1.4.0
Ubuntu Server 20.04 LTS
Offline
Yes, this may be easier to share data and screenshots.
Once created, add here a link to the github issue.
No support with MP - Always run an upgrade task on a testing instance before running it on production! Always backup before any upgrade task!
Offline
--
GLPI 10.0.17
GLPI-Inventory 1.4.0
Ubuntu Server 20.04 LTS
Offline