Skip to content

Form import impossible due to formatDefaultValueForDB() return type error #34

Description

@Aurely9n

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

GLPI Version

11.0.8

Plugin version

1.1.1

Bug description

Hi,

I'm facing this error when i try to import a form from my test environnement (identical) to prod environnement :
Uncaught PHP Exception TypeError: "Glpi\Form\QuestionType\AbstractQuestionType::formatDefaultValueForDB(): Return value must be of type ?string, array returned" at AbstractQuestionType.php line 56.

Test and prod environnements are the same.
My form has been created under previous GLPI 11.0.7 (without old plugin formcreator).

I've already import previous form without problem but this one use the advancedform list LDAP field questionType.

Thx

Relevant log output

[2026-07-07 07:57:12] glpi.CRITICAL:   *** Uncaught PHP Exception TypeError: "Glpi\Form\QuestionType\AbstractQuestionType::formatDefaultValueForDB(): Return value must be of type ?string, array returned" at AbstractQuestionType.php line 56
  Backtrace :
  ...i/Form/QuestionType/AbstractQuestionType.php:56 
  ./src/Glpi/Form/Question.php:395                   Glpi\Form\QuestionType\AbstractQuestionType->formatDefaultValueForDB()
  ./src/Glpi/Form/Question.php:278                   Glpi\Form\Question->prepareInput()
  ./src/CommonDBTM.php:1341                          Glpi\Form\Question->prepareInputForAdd()
  ...i/Form/Export/Serializer/FormSerializer.php:628 CommonDBTM->add()
  ...i/Form/Export/Serializer/FormSerializer.php:323 Glpi\Form\Export\Serializer\FormSerializer->importQuestions()
  ...i/Form/Export/Serializer/FormSerializer.php:307 Glpi\Form\Export\Serializer\FormSerializer->doImportFormFormSpecs()
  ...i/Form/Export/Serializer/FormSerializer.php:254 Glpi\Form\Export\Serializer\FormSerializer->importFormFromSpec()
  ...oller/Form/Import/Step4ExecuteController.php:75 Glpi\Form\Export\Serializer\FormSerializer->importFormsFromJson()
  ./vendor/symfony/http-kernel/HttpKernel.php:181    Glpi\Controller\Form\Import\Step4ExecuteController->__invoke()
  ./vendor/symfony/http-kernel/HttpKernel.php:76     Symfony\Component\HttpKernel\HttpKernel->handleRaw()
  ./vendor/symfony/http-kernel/Kernel.php:208        Symfony\Component\HttpKernel\HttpKernel->handle()
  ./public/index.php:71                              Symfony\Component\HttpKernel\Kernel->handle()

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

GLPI 11.0.8
PHP: 8.5.8 fpm-fcgi
Web server: Apache/2.4.67 (Debian) ()
Database: 10.11.14-MariaDB-0+deb12u2-log

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions