every hour calculation is wrong, add every month

fred0 - June 10, 2009 - 23:06
Project:Webform
Version:6.x-2.9
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

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)'),

#1

fred0 - November 8, 2009 - 22:04
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

quicksketch - November 8, 2009 - 22:50
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

fred0 - November 8, 2009 - 23:05

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

#4

quicksketch - November 9, 2009 - 00:33

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.

#5

fred0 - November 9, 2009 - 00:44

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

quicksketch - November 9, 2009 - 01:13

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.

 
 

Drupal is a registered trademark of Dries Buytaert.