pluginsGLPI / formcreator

GLPI Plugin Formcreator (DOWNLOAD : https://github.com/pluginsGLPI/formcreator/releases)
http://www.teclib-edition.com
GNU General Public License v3.0
174 stars 125 forks source link

Formcreator problem #2828

Closed veniphere closed 2 years ago

veniphere commented 2 years ago

When submitting a form by using the FormCreator plugin , we got a white page and no case is created at the end (letting me suspecting another problem than a redirect page).

By enabling the debug mode we have the following message:

Uncaught Exception TypeError: Argument 1 passed to Glpi\Toolbox\Sanitizer::isNsClassOrCallableIdentifier() must be of the type string, array given, called in /var/www/glpi/src/DBmysql.php on line 1255 in /var/www/glpi/src/Toolbox/Sanitizer.php at line 226

Is there a possibility that a question like multiselect or radio lead us to such a problem (array vs string ?), dunno.

About that, the checkbox question type has a bug when trying to fill default values: here we add some default values image when saved and tested somtimes there is no default values and sometimes there is, when there is not and if i reopen the question there is no default values seen as ou can see here image but the story do not ends here, when there is default values and if i reopen the question ti edit it, i cannot see default values even if shown on the form itself...

btry commented 2 years ago

Hi

If you're not using the version 2.13.0-rc.1, then please upgrade and tell if the problem persists

veniphere commented 2 years ago

version used is 2.13.0-beta.2 downloaded this morning, looking for 2.13.0-rc.1 released 6 hours ago and will be back soon

veniphere commented 2 years ago

version used just deployed: image

behavior is same: Uncaught Exception TypeError: Argument 1 passed to Glpi\Toolbox\Sanitizer::isNsClassOrCallableIdentifier() must be of the type string, array given, called in /var/www/glpi/src/DBmysql.php on line 1255 in /var/www/glpi/src/Toolbox/Sanitizer.php at line 226

and same as well for the default values of the checkbox question image

even if behavior is this one expected (default values correctly set) image

btry commented 2 years ago

Can you export the form and share the json file ?

btry commented 2 years ago

Hi

Please search in glpi/files/_log/php-errors.log the backtrace for the error you have on screen.

veniphere commented 2 years ago

Here is the php-erros.log

[2022-06-08 13:46:00] glpiphplog.CRITICAL: *** Uncaught Exception TypeError: Argument 1 passed to Glpi\Toolbox\Sanitizer::isNsClassOrCallableIdentifier() must be of the type string, array given, called in /var/www/glpi/src/DBmysql.php on line 1255 in /var/www/glpi/src/Toolbox/Sanitizer.php at line 226 Backtrace : src/DBmysql.php:1255 Glpi\Toolbox\Sanitizer::isNsClassOrCallableIdentifier() src/DBmysql.php:1286 DBmysql::quoteValue() src/DBmysql.php:1310 DBmysql->buildInsert() src/CommonDBTM.php:682 DBmysql->insert() src/CommonDBTM.php:1274 CommonDBTM->addToDB() plugins/formcreator/inc/targetticket.class.php:940 CommonDBTM->add() plugins/formcreator/inc/formanswer.class.php:867 PluginFormcreatorTargetTicket->save() plugins/formcreator/inc/formanswer.class.php:1088 PluginFormcreatorFormAnswer->generateTarget() src/CommonDBTM.php:1275 PluginFormcreatorFormAnswer->post_addItem() plugins/formcreator/front/form.form.php:140 CommonDBTM->add()

veniphere commented 2 years ago

Hi, Here it is, i would prefer to do not make it available on github

BEst

On Tue, Jun 7, 2022 at 8:20 PM btry @.***> wrote:

Can you export the form and share the json file ?

— Reply to this email directly, view it on GitHub https://github.com/pluginsGLPI/formcreator/issues/2828#issuecomment-1149016006, or unsubscribe https://github.com/notifications/unsubscribe-auth/AY57RCTW5223YZ73GVNFTRDVN6HGJANCNFSM5YDODFAQ . You are receiving this because you authored the thread.Message ID: @.***>

btry commented 2 years ago

If you cannot publish the form, try to reproduce the problem on a very simple test form, and export it. In the mean time i might find the solution from the backtrace alone.

veniphere commented 2 years ago

here the json export_formcreator_20220623_2332.json.gz

btry commented 2 years ago

Hi

There is a problem in the target ticket conception. The type (incident or request) is set from the 1st question Kind of account (apprentice, employee, ...).

You need to fix that in the target ticket. As I did not saw any question eligible to set the type of the ticket, you probably want to set it as a request.

btry commented 2 years ago

This fix will log an explicit error and ignore the invalid question type

f5de8bb6

btry commented 2 years ago

Hi

Having no feedback, I close this issue.