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 2023-04-12 13:58:54

WebGreg
Member
Registered: 2020-02-27
Posts: 729

Formcreator with GLPI 10.0.7 - Invalid argument at line 55

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.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS

Offline

#2 2023-04-12 14:00:48

btry
Moderator
Registered: 2015-10-01
Posts: 593

Re: Formcreator with GLPI 10.0.7 - Invalid argument at line 55

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

#3 2023-04-12 14:02:19

btry
Moderator
Registered: 2015-10-01
Posts: 593

Re: Formcreator with GLPI 10.0.7 - Invalid argument at line 55

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

#4 2023-04-12 14:14:15

WebGreg
Member
Registered: 2020-02-27
Posts: 729

Re: Formcreator with GLPI 10.0.7 - Invalid argument at line 55

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.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS

Offline

#5 2023-04-12 14:28:43

btry
Moderator
Registered: 2015-10-01
Posts: 593

Re: Formcreator with GLPI 10.0.7 - Invalid argument at line 55

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

#6 2023-04-12 14:36:33

WebGreg
Member
Registered: 2020-02-27
Posts: 729

Re: Formcreator with GLPI 10.0.7 - Invalid argument at line 55

btry wrote:

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.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS

Offline

#7 2023-04-12 14:39:32

btry
Moderator
Registered: 2015-10-01
Posts: 593

Re: Formcreator with GLPI 10.0.7 - Invalid argument at line 55

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

#8 2023-04-12 14:41:18

WebGreg
Member
Registered: 2020-02-27
Posts: 729

Re: Formcreator with GLPI 10.0.7 - Invalid argument at line 55

Do you want a github ticket for this?


--
GLPI 10.0.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS

Offline

#9 2023-04-12 14:51:05

btry
Moderator
Registered: 2015-10-01
Posts: 593

Re: Formcreator with GLPI 10.0.7 - Invalid argument at line 55

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

#10 2023-04-12 17:27:17

WebGreg
Member
Registered: 2020-02-27
Posts: 729

Re: Formcreator with GLPI 10.0.7 - Invalid argument at line 55


--
GLPI 10.0.7
GLPI-Inventory 1.2.1
Ubuntu Server 20.04 LTS

Offline

Board footer

Powered by FluxBB