Form import impossible due to formatDefaultValueForDB() return type error
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- PHP
- Stars
- 4
- Forks
- 4
- Avg merge
- 7d 7h
- Merged PRs (30d)
- 3
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pluginsGLPI/advancedforms
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
pluginsGLPI/advancedforms#57 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
pluginsGLPI/advancedforms#55 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
pluginsGLPI/advancedforms#29 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
pluginsGLPI/advancedforms#28 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
pluginsGLPI/advancedforms#27 ·
All issues in pluginsGLPI/advancedforms
Similar issues
-
jira-created
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
nunomaduro/phpinsights#745 ·
-
status/awaiting_triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
WordPress/plugin-check#1486 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
az-digital/az_quickstart#6019 ·