glpi-project/glpi

GLPI11 RC4 Approval Step mandatory on Ticket but not in Templates

Closed this issue · 1 comments

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

11.0.0-rc4

Bug description

Creating an approval step does not require the filed Approval step to be filled out.

Image

But when adding an Approval to a ticket, the Approval step is required.

Image

So when using an Template which does not have the field filled out it will throw an error. See Log output for more details.

Image

Relevant log output

glpi.CRITICAL:   *** Uncaught PHP Exception RuntimeException: "" at CommonITILValidation.php line 2070
  Backtrace :
  ./src/CommonITILValidation.php:2070                
  ./src/CommonITILValidation.php:327                 CommonITILValidation->addITILValidationStepFromInput()
  ./src/CommonDBTM.php:1336                          CommonITILValidation->prepareInputForAdd()
  ./front/commonitilvalidation.form.php:82           CommonDBTM->add()
  ./front/ticketvalidation.form.php:40               include()
  ...Glpi/Controller/LegacyFileLoadController.php:63 require()
  ./vendor/symfony/http-kernel/HttpKernel.php:181    Glpi\Controller\LegacyFileLoadController->__invoke()
  ./vendor/symfony/http-kernel/HttpKernel.php:76     Symfony\Component\HttpKernel\HttpKernel->handleRaw()
  ./vendor/symfony/http-kernel/Kernel.php:197        Symfony\Component\HttpKernel\HttpKernel->handle()
  ./public/index.php:70                              Symfony\Component\HttpKernel\Kernel->handle()

Page URL

/front/ticket.form.php AND /front/validationstep.form.php

Steps To reproduce

  1. Create approval template without the field Approval step filled
  2. Add Approval to Ticket by template

Your GLPI setup information

No response

Anything else?

No response

On browser side, there is no more an empty choice ( fixed in #21048 ). The default validation step is selected by default and no '-----' / empty choice is available.
On server side, the creation is forbidden by an exception. This is an expected exception (but it needs a message - will be fixed in #21068 )