I was looking through the module code to add an option to limit submissions to 1 per month and found that the setting for every hour was wrong. It was set to 1600 when 60 * 60 = 3600.
Also, I'd like to suggest adding an every month option. Since figuring out what month it is to get the number of days seems unnecessary, I'm thinking of standardizing on a 30 day period like this:
'2592000' => t('every month (30 days)'),
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | webform.module.patch | 565 bytes | fred0 |
Comments
Comment #1
fred0 commentedJust realized that this bug persists in the latest release. Here's a patch. Hopefully this can get fixed asap!
Comment #2
quicksketchThanks the hour fix is definitely necessary. The month feature should be done separately. I believe there has been a request in the past to support calendar weeks/months. Critical bugs are reserved for bugs that render Webform completely inoperable.
Comment #3
fred0 commentedHow do mean separately? As a new issue with patch?
Comment #4
quicksketchI'd suggest splitting out the change and making a new issue yes. However I'm not keen on adding an option for "month (30 days)", since its no different than just entering "[ 30 ] [ days ]" from the existing options. If you're interested in supporting calendar months/weeks, I'd be happy to see that added to #597438: Limit submission by Calendar Week and Month.
Comment #5
fred0 commentedOk, can do on a new issue.
However, the existing option in v2.9 says:
Limit to [X] submission(s) [period]
Given that, entering [30] and setting days would limit to 30 submissions per day and not [X] submissions every 30 days.
Comment #6
quicksketchAh fair enough. I realized some people might also want to make hours or days work by calendar dates also (resetting at midnight or at the top of the hour for example), so making a special option just for week and month might not be satisfactory. We'll need to think out these problems in #597438: Limit submission by Calendar Week and Month.
Comment #7
quicksketchLet's follow the patch posted in #597438: Limit submission by Calendar Week and Month.
Comment #8
quicksketchNote that I did correct the hour issue, where an hour is 3600 seconds, not 1600. We'll use this issue for historical record of that fix.