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

RFC: Allow a form to be "closed" #1175

Open
JamesDPC opened this issue Nov 4, 2022 · 4 comments
Open

RFC: Allow a form to be "closed" #1175

JamesDPC opened this issue Nov 4, 2022 · 4 comments

Comments

@JamesDPC
Copy link

JamesDPC commented Nov 4, 2022

I was chucking around the idea of having a module to allow closure of a form for submissions, but thought it would be more useful in the core module. The gist is that a site owner might want to keep a page holding a form published but without that form taking submissions.

Basically:

  • a checkbox "Close form for submissions" or with similar text, default unchecked
  • when submissions are closed, the form does not display and does not take submissions
  • when submissions are closed, there is some alternate content show, via a template or an editable HTML field (probably the latter).

Is this something the maintainers would think a useful feature?

@michalkleiner
Copy link
Contributor

This is probably not the best place to discuss this, would suggest the forum.
You can simply unpublish the form, and if using it via elemental you can even unpublish just the block and have another block above/below it with the alternate content. I'd say the existing modules and the CMS itself already provide a reasonable way to achieve what you're after.

@JamesDPC
Copy link
Author

JamesDPC commented Nov 6, 2022

Thanks for replying.

You can simply unpublish the form, and if using it via elemental you can even unpublish just the block and have another block above/below it with the alternate content. I'd say the existing modules and the CMS itself already provide a reasonable way to achieve what you're after.

Not really, in the case of an unpublished userform content block when the owner page/dataobject gets published it will be published again. Archiving the element has led to issues with submissions disappearing on restore (plus having to recover from archive).

I'll investigate this with a module and see how it pans out.

@NightJar
Copy link
Contributor

NightJar commented Nov 6, 2022

not the best place to discuss this, would suggest the forum

It's an RFC, just tag it as such.

I think it's a reasonable idea @JamesDPC - it seems reasonable to me to keep all the content on a page available but remove the form (and prevent submissions if someone tries to e.g. manually POST to it). Anything else is just a usability hassle.

In the very least adding hooks in the appropriate places (if they don't exist) so you can achieve this via a module that uses Extensions on a UserForm would (should) be a welcome change. That way you can create a module as a proof of concept, and the core folk don't have to support any new API.

@michalkleiner
Copy link
Contributor

I didn't want to come across as completely dismissive, so apologies if that was the case.

If there was a PR to look at adding this functionality we'd be happy to review it. If it wasn't possible within the module and extensions points were missing, also happy to enhance the current code to be able to support an external module if it was decided to go that way.

I agree that unpublishing a single element and keeping it unpublished is a hassle when the whole page is published.

@michalkleiner michalkleiner changed the title Feature request: allow a form to be "closed" RFC: Allow a form to be "closed" Nov 7, 2022
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