This is related to #1444472: Webform doesn't create a node revision on save
It would be very useful to make webforms participate in basic drupal revisioning. Seems like it would probably not be that hard - perhaps just adding vid columns to the webform and webform_component tables? I can probably get some resources to work on this. Any interest in seeing this added to the module? Any caveats or gotchas you can think of?
Thanks

Comments

taquil’s picture

I'd be very excited for this as well. I was finally able to present webforms I built to the principals, and they did mention that a couple of their forms get used by clients over and over with just slight changes. Being able to pull up a previous submission, make a couple changes, then "Save As New" would be a huge boon. I don't think it wouldn't even require any changes to manage versions. Simply pre-filling the form with a previous SID's data would be a big help. Can a button be added on the "previous submissions" page to "view in form" and fill in the components according to that SID+CID?

quicksketch’s picture

Hi guys. @taquil, your request actually sounds different than the original poster's, since you're talking about revisioning *submissions*, and @wodenx is talking about revisioning the *webform node*.

Regarding the original request, I see no progress has been posted yet. Possibly because revisioning the webform nodes themselves is a significant challenge. What happens when you edit a form to remove options from a select list? What happens to the data that was previously set using the old options? The same problem is encountered when deleting entire fields. Normally Webform "cleans up" this data, but if you have the ability to revert to a previous revision, that data would have to stick around. Additionally, revisioning webforms could result in a massive increase in node revisions. Do you create a new revision after every component update? If you edit an existing component, does that create a new revision? Or would you add a "create new revision button" throughout the webform interface? Introducing revisions could end up putting a burden on the end-users.

All of the problems aside, I'm not opposed to revisioning Webforms. I just think that it's going to take a serious effort and a lot of UX thinking to make the functionality work.

quicksketch’s picture

Title:Make webforms revisionable» Make webform nodes support revisions

Clarifying title so people know we're talking about revisioning nodes, not submissions here.

alisonjo2786’s picture

@quicksketch it does sound really complex, but I strongly agree that it's important functionality. I don't think it would be a burden on end-users, I think people who use Drupal revisioning want (or are prepared for) the huge pile of UX and additional data consequences? (And of course you don't have to enable revisions for an entire site or content type.) Additionally, Webform's lack of revisioning leads to problems when you have revisioning (and/or Workbench Moderation) enabled for Webform-enabled node types.

Anyway, I'm not really qualified to contribute real help with this problem, unfortunately, just wanted to add my two cents and give a general "+1" to this feature request. Thanks!

wodenx’s picture

@quicksketch - when you say the data that was previously set - i assume you're talking about submissions? what issues do you foresee with regard to keeping submitted data for components which are deleted or modified? To me, it seems as though we might want to keep those data around anyway. Modifying a form doesn't necessarily mean you want to throw away all data collected via that form. Of course we'd have to think of a way of making those data accessible, and we'd have to make sure that cid's for particular components weren't reused.

I agree the UX issues are a bit complex. One solution might be to have changes to a webform always apply to the current revision of the node - so you'd create a new revision first (from the node edit form), and then modify the webform data for the new revision. However, my use case specifically involves creating *draft* revisions via workbench_moderation, and that would probably require a bit of extra work.

Working on this is still in our backlog -- we've just had a lot of other things prioritized.

alisonjo2786’s picture

One solution might be to have changes to a webform always apply to the current revision of the node - so you'd create a new revision first (from the node edit form), and then modify the webform data for the new revision. However, my use case specifically involves creating *draft* revisions via workbench_moderation, and that would probably require a bit of extra work.

This is what happens now, sort of -- including the workbench moderation-related side effects (at least on our site). [warning: approaching slight tangent...] What I mean is, every time you save changes to a Webform (the actual Webform), the current revision gets updated (no details of the Webform changes are part of the change history, it just adds on a node history record, sort of). We had the content type configured with default publishing status = draft, so this meant every time we saved changes to a Webform, the node would go into Draft state (as far as WB was concerned; as far as Drupal was concerned it was still "published"; the whole thing was very strange). BUT, we found this to be an issue with WB moderation, and the patch here has addressed the WB moderation-related issues with "using" the current revision.

wodenx’s picture

@alisonjo2786 - can you link to the workbench patch you reference? Thanks.

lollipopp’s picture

It would be good to have the patch for WB. Or can it be found in the latest dev version?

wodenx’s picture

@alisonjo

This is what happens now, sort of

Not exactly - the webform changes aren't associated with any specific revision -- they appear to affect the "current" revision, but if you were to revert to a previous revision, or make them to an unpublished revision, they would still apply.

Again - would be great to see the WB patch...

rudiedirkx’s picture

Issue summary:View changes
jgrillet’s picture

it would be great to have this possibility!

DanChadwick’s picture

Status:Active» Closed (won't fix)

I think revision control for either webform nodes (components, e-mails, conditionals, and form settings) and submissions is beyond the scope of what webform can do. This feature is too ambitious to consider. If implemented, the complication to webform would not justify the complexity.

atoledo@ciandt.com’s picture

Adding to this thread, my situation is that our website functions as a rest server and we are also using the webform_service module. The webforms are served to mobile applications and regarding the revisions, we only need to know if there was an update or not to the webform node. We don't actually need to control the components and conditionals revisions.

The current implementation does not increment the revision number when editing the components or conditionals for example. Adding the node_object_prepare($node); to the form functions would fix this. Just like in the node_form().

DanChadwick’s picture

Re #13, it seems like you could easily add this yourself with some hook_FORMID_alter() implementations. If you want this integrated into webform itself -- and I'm not opposed -- please create a new issue with patches for the 7.x-4.x and 8.x branches (or 1 patch if it applies to both). The D8 need not be functional -- we just want to preserve the unported code in that branch.

Posting to closed issues doesn't usually get attention. :)