Redirect to next form
Changes description
Adds the possibility to redirect to another form when a form is completed.
Hi @btry I changed the order of the fields. What do I have to modify in the test file?
Hi
Check the test execution log of your PR (latest run is here : https://github.com/pluginsGLPI/formcreator/pull/2173/checks?check_run_id=2119989310)
Exporting a form is broken because you aded a new field. Tests need to be updated to to recognize this new field

Also as the new field is a foreign key to a form, you need to add logic to
- convert a form ID into an UUID on export
- convert an UUID into a form ID on import.
See the export and import methods of PluginFormcreatorForm to apply those changes. This feature is implemented in a rather compicated way. If you don't understand well how it works, I'll handle this, but it may take time before I find enough time for tis task. The target version for your feature is 2.12.0.
Hi @btry I modified the tests but it failed again. Can you tell me what needs to be modified?
I need to push this contribution to a later version : a few things to solve before to merge
- import of forms
- deletion of forms
- infinite loops across linked forms
Hello,
I think we should add conditions to determine whether or not it redirects to the next form, in the same way as for targets. or choose which form to redirect to via the answer to a question.
Hi
for now there is an important problem with this feature. some users will use it a lot, and there is a risk of infinite loop. For example 3 forms A,B and C with A next B next C.
This is the main reason i did not merge this feature. It is incomplete for now and I don't had enough time to add code to avoid such loop.
Infinite loops could be prevented by maintaining a list of form IDs in the chain and passing this to each target form. This list could be checked to see whether the next target form has already been a target in the chain and the chain stopped with an error.