We had to close a very popular form and we received submission hours after having closed it. We do not know if those users let the form open for hours in their browser window. It make me curious if they is any validation that the form is still open at the time of submission ?

CommentFileSizeAuthor
#8 webform_check_closed-1205736.patch1.19 KBquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nardberjean’s picture

We asked a user and he confirmed he submitted the form from a browser window open for hours...

quicksketch’s picture

Title: It seems like users have been able to submit a webform hours after it has been closed » Users still able to submit a form (from cache or open browser window) after it has been manually closed
Category: support » bug

Thanks, this is a good report. I've checked our validate function (webform_client_form_validate) and while it has protections to prevent a user from exceeding their individual limit (say 1 per person), it does not provide any code to check that the form is still open at the time of submission. I've changed this to a bug report and we can work on addressing it before the next release of Webform.

vernond’s picture

I have planned a custom module to enable the automatic closing of a webform at a specified date+time, and/or when a specified max number of submissions have been received. The validation bits of the proposed module would, in principle, incorporate this request. Would it be better to leave this module as a separate thing entirely, or is there benefit in doing the whole lot as a webform patch?

quicksketch’s picture

Right now we've actually got a bug in Webform module that $node->webform['status'] is not checked when a webform is filled out. You could easily run into this problem (as the original reported did) by manually setting the form to "Closed". So this is a legit request that should be fixed separately. I'd personally prefer to have any module that provides scheduled opening/closing to be a separate module.

nardberjean’s picture

Good news, thanks !

vernond’s picture

@nardberjean - The webform_submission_limits module (http://drupal.org/project/webform_limit_submissions) does what you're after. I've posted an extended version of the module for review. Perhaps you could take some time to see if meets your requirement and provide feedback in the issue at http://drupal.org/node/1225780

nardberjean’s picture

Thanks!

quicksketch’s picture

Version: 6.x-3.11 » 7.x-4.x-dev
Issue summary: View changes
Status: Active » Fixed
FileSize
1.19 KB

I've committed this patch which solves the "form was submitted after the form was closed" issue for 7.x-4.x. The 3.x branch doesn't have a discrete open/closed setting, so this doesn't apply there. It sounds like for @nardberjean's original problem, it may be solved by @vernond's module.

This patch also removes the UID 1 check, which is more often confounding than it is helpful.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

fenstrat’s picture

Version: 7.x-4.x-dev » 8.x-4.x-dev
Assigned: Unassigned » fenstrat
Status: Closed (fixed) » Patch (to be ported)

Needs porting to 8.x-4.x.

fenstrat’s picture

Version: 8.x-4.x-dev » 7.x-4.x-dev
Assigned: fenstrat » Unassigned
Status: Patch (to be ported) » Fixed

Committed and pushed 1c84710 to 8.x-4.x. Thanks!

  • Commit 0884250 on 8.x-4.x authored by quicksketch, committed by fenstrat:
    Issue #1205736 by quicksketch: Users still able to submit a form (from...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.