Background:

I am aware that webforms being configurable entity and being a simple form in reality is not/does not qualify to be revisionable.

In my case, it is required that the webform be reviewed by potentially two levels of review before being available for use.

I'm implementing this functionality by using entity CRUD hooks, form alters and custom code for moderation forms. When an author creates the form it is automatically set as closed, accessibility to change form status restricted and appropriate moderation message is displayed to them.

Users with ability to moderate the form can then approve the form, which internally sets form status to Open and updates the respective status in my custom table. Once this is done the webform build will be updated such that users cannot add/edit/update elements to it without changing it to draft (which internally changes the form status to Closed).

Problem:

So when a form is already approved and live (linked to an article) to the end-users, making changes requires to close it for a brief period of time until it is reviewed and approved again.

I'm looking for suggestions on how this situation could be circumvented, where a possible faux-revison of the form can be reviewed and later updated over the original while the original form is still available to the end users. Some pointers on the possibility of achieving this or alternate method would be really helpful.

Comments

optimusprime619 created an issue. See original summary.

jrockowitz’s picture

The Views UI module allows a View (config entity) to be updated without any changes going live until the Views is 'saved'. The Webform module could/should provide this functionality using the SharedTempStore, this seems like a lot of work.

Maybe someone could create a 'Revisionable config entity' module.

A completely different approach would be to have people edit a webform on staging server and then push the config change to production via GIT or webservice.

optimusprime619’s picture

Thanks for the response, cannot appreciate enough the ownership you have displayed with this project and the effort you have put into it.
Using a stage to prod like deploy mechanism might not be applicable in my case, will try to see if I can make something with SharedTempStore .
If I manage to implement said functionality, will revert with details on the same so that it might help someone with similar use case.

jrockowitz’s picture

Implementing SharedTempStore is going to be a major effort. I recommend trying to start simple and maybe just getting the form builder to use the SharedTempStore.

Another approach I have used for understanding complex undocumented APIs is to write an example module and contribute it back the community.

jrockowitz’s picture

Status: Active » Closed (won't fix)