Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[main] Twig Error on default forms #18378

Open
2 tasks done
flegastelois opened this issue Nov 22, 2024 · 1 comment
Open
2 tasks done

[main] Twig Error on default forms #18378

flegastelois opened this issue Nov 22, 2024 · 1 comment

Comments

@flegastelois
Copy link
Member

flegastelois commented Nov 22, 2024

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

Version

main

Bug description

Image

Image

Relevant log output

[2024-11-22 15:16:19] glpiphplog.CRITICAL:   *** Twig Error (Twig\Error\RuntimeError): "An exception has been thrown during the rendering of a template ("Glpi\Form\QuestionType\AbstractQuestionType::getDefaultValueConfig(): Argument #1 ($serialized_data) must be of type array, int given, called in /www/glpi-core/main/htdocs/src/Glpi/Form/QuestionType/QuestionTypeItem.php on line 143")." in template "/www/glpi-core/main/htdocs/templates/pages/admin/form/form_question.html.twig" at line 118
  Backtrace :
  vendor/twig/twig/src/Template.php:343              Twig\Template->yield()
  vendor/twig/twig/src/TemplateWrapper.php:42        Twig\Template->display()
  src/Glpi/Application/View/TemplateRenderer.php:187 Twig\TemplateWrapper->display()
  src/Glpi/Form/Question.php:87                      Glpi\Application\View\TemplateRenderer->display()
  .../twig/twig/src/Extension/CoreExtension.php:1861 Glpi\Form\Question->displayBlockForEditor()
  ...tes/71/71d3ff8a945c9213dea3d7bb00ac8f5c.php:288 Twig\Extension\CoreExtension::getAttribute()
  vendor/twig/twig/src/Template.php:387              __TwigTemplate_c22edd1412869fdce150ecbfea2b5ad9->doDisplay()
  vendor/twig/twig/src/Template.php:343              Twig\Template->yield()
  vendor/twig/twig/src/Template.php:358              Twig\Template->display()
  vendor/twig/twig/src/TemplateWrapper.php:35        Twig\Template->render()
  .../twig/twig/src/Extension/CoreExtension.php:1479 Twig\TemplateWrapper->render()
  ...tes/29/29c031bab018481a01b0e4a472e7d917.php:203 Twig\Extension\CoreExtension::include()
  vendor/twig/twig/src/Template.php:387              __TwigTemplate_2933a92cd1e9309f7f001711abc64fb7->doDisplay()
  vendor/twig/twig/src/Template.php:343              Twig\Template->yield()
  vendor/twig/twig/src/TemplateWrapper.php:42        Twig\Template->display()
  src/Glpi/Application/View/TemplateRenderer.php:187 Twig\TemplateWrapper->display()
  src/Glpi/Form/Form.php:121                         Glpi\Application\View\TemplateRenderer->display()
  src/CommonGLPI.php:667                             Glpi\Form\Form->showForm()
  ajax/common.tabs.php:112                           CommonGLPI::displayStandardTab()
  ...Glpi/Controller/LegacyFileLoadController.php:59 require()
  vendor/symfony/http-kernel/HttpKernel.php:101      Glpi\Controller\LegacyFileLoadController->Glpi\Controller\{closure}()
  ...ymfony/http-foundation/StreamedResponse.php:106 Symfony\Component\HttpKernel\HttpKernel::Symfony\Component\HttpKernel\{closure}()
  vendor/symfony/http-foundation/Response.php:423    Symfony\Component\HttpFoundation\StreamedResponse->sendContent()
  src/Glpi/Kernel/Kernel.php:255                     Symfony\Component\HttpFoundation\Response->send()
  public/index.php:58                                Glpi\Kernel\Kernel->sendResponse()

Page URL

/front/form/form.form.php?id=1

Steps To reproduce

No response

Your GLPI setup information

No response

Anything else?

No response

@trasher
Copy link
Contributor

trasher commented Nov 22, 2024

I confirm he issue on my side. default_value field for table glpi_forms_questions has sevral values set to 0 on my side, while it seems the expected is a JSON string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants