Posted by fred0 on June 10, 2009 at 11:06pm
| Project: | Webform |
| Version: | 6.x-2.9 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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)'),
Comments
#1
Just realized that this bug persists in the latest release. Here's a patch. Hopefully this can get fixed asap!
#2
Thanks 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.
#3
How do mean separately? As a new issue with patch?
#4
I'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.
#5
Ok, 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.
#6
Ah 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.
#7
Let's follow the patch posted in #597438: Limit submission by Calendar Week and Month.
#8
Note 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.
#9
Automatically closed -- issue fixed for 2 weeks with no activity.