Download & Extend

Every hour calculation is wrong

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

Version:6.x-2.7» 6.x-2.9
Priority:normal» critical

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

AttachmentSize
webform.module.patch 565 bytes

#2

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.

#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

Status:needs review» closed (duplicate)

Let's follow the patch posted in #597438: Limit submission by Calendar Week and Month.

#8

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.

#9

Status:fixed» closed (fixed)

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

nobody click here