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

Form Template / Blueprint doesn't respect Workflows #909

Closed
AaronSadlerUK opened this issue Nov 5, 2022 · 3 comments
Closed

Form Template / Blueprint doesn't respect Workflows #909

AaronSadlerUK opened this issue Nov 5, 2022 · 3 comments

Comments

@AaronSadlerUK
Copy link

A brief description of the issue goes here.

When creating a form template / blueprint it does not retain the preconfigured Workflows.

Reproduction

Specifics

Create a form and then export it to the json file, when this is added to App_Plugins/Data/Templates the form fields are retained, however the workflows are not

Steps to reproduce

Create a form
Export to json file
Put json file in App_Plugins/Data/Templates/
Attempt to create a form from the template

Expected result

Both the form properties and workflows should be preconfigured

Actual result

Only the form fields are preconfigured

@andersonrosilva
Copy link

Hello,
How you to export to json after created form? Is by the CMS?
I'm begginner in Umbraco Forms and wanted know how to create the templates with "easy" process.
Thanks.

@AndyButland
Copy link

I've had a look into this one, and unfortunately it's not a quick bug to fix. Looking back historically, it doesn't seem to be the case that form templates ever supported workflows. I believe this stems back from when form definitions were stored on disk; forms and their workflows were stored in separate JSON files. Only the former could be used as templates, and hence they never allowed the creation of forms with workflows from a template.

In V9, when we moved to only offering the option of storing forms in the database, we added a feature to allow for the import and export of forms to files on disk. This was mainly done to offer developers used to storing forms as files in source control, and not using a solution like Umbraco Deploy or uSync, a means to still be able to do this.

When we implemented that export/import, we did include the workflows. So, as you've found, they are there in JSON files.

However the logic for creating forms from templates hasn't been updated, so doesn't recognise the workflows when these files are used as templates.

It's possible to amend this such that it does import them, and we'll look at doing that for the next feature release. It needs to be more than in a patch though, as there's some rework needed to support this (specifically the existing IFormTemplateStorage, which only returns instances of Form rather than FormDesign objects, with the former not having properties related to workflows).

@AndyButland
Copy link

We're including an update to resolve this issue in the next minor releases, such that if workflows are in the template files they'll be used in creating the new form.

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

3 participants