Form import impossible due to formatDefaultValueForDB() return type error

Abierto
#34 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
php
Área
backend

Línea de trabajo

Start at src/Glpi/Form/QuestionType/AbstractQuestionType.php line 56 and trace the call through src/Glpi/Form/Question.php and FormSerializer.php during form import. Reproduce the import with an advancedform LDAP field question, then verify that the default value is handled without the reported return-type error.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
PHP
Estrellas
4
Forks
4
Merge medio
7 d 7 h
PR fusionados (30 d)
3

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pluginsGLPI/advancedforms

Todos los issues de pluginsGLPI/advancedforms

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.