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)'),
CommentFileSizeAuthor
#1 webform.module.patch565 bytesfred0

Comments

fred0’s picture

Version: 6.x-2.7 » 6.x-2.9
Priority: Normal » Critical
StatusFileSize
new565 bytes

Just realized that this bug persists in the latest release. Here's a patch. Hopefully this can get fixed asap!

quicksketch’s picture

Priority: Critical » Normal
Status: Active » Needs review

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.

fred0’s picture

How do mean separately? As a new issue with patch?

quicksketch’s picture

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.

fred0’s picture

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.

quicksketch’s picture

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.

quicksketch’s picture

Status: Needs review » Closed (duplicate)
quicksketch’s picture

Title: every hour calculation is wrong, add every month » Every hour calculation is wrong
Status: Closed (duplicate) » Fixed

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.

Status: Fixed » Closed (fixed)

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