Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 ?
Comment | File | Size | Author |
---|---|---|---|
#8 | webform_check_closed-1205736.patch | 1.19 KB | quicksketch |
Comments
Comment #1
nardberjean CreditAttribution: nardberjean commentedWe asked a user and he confirmed he submitted the form from a browser window open for hours...
Comment #2
quicksketchThanks, 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.
Comment #3
vernond CreditAttribution: vernond commentedI 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?
Comment #4
quicksketchRight 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.
Comment #5
nardberjean CreditAttribution: nardberjean commentedGood news, thanks !
Comment #6
vernond CreditAttribution: vernond commented@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
Comment #7
nardberjean CreditAttribution: nardberjean commentedThanks!
Comment #8
quicksketchI'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.
Comment #10
fenstratNeeds porting to 8.x-4.x.
Comment #11
fenstratCommitted and pushed 1c84710 to 8.x-4.x. Thanks!