Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Form import impossible due to formatDefaultValueForDB() return type error

オープン
#34 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
php
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
PHP
スター
4
フォーク
4
平均マージ
7日 7時間
マージ済み PR(30日)
3

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pluginsGLPI/advancedforms のほかの issue

pluginsGLPI/advancedforms の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。