form is still displayed even if max number exceeded

Morbus Iff - March 28, 2008 - 13:14
Project:Webform
Version:5.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Morbus Iff
Status:closed
Description

A form is still displayed even if the user has exceeded the number of times they can submit a form.

#1

Morbus Iff - March 28, 2008 - 15:30
Assigned to:Anonymous» Morbus Iff
Status:active» needs review

In this case, most of the relevant code was in webform_client_form_validate, alojng with a healthy bit of watchdogs. The methodology in here is all wrong: you offer the ability to limit form submissions, but then you tease the user with the form display anyways, then spend a good 15 lines or so telling the admins that the user WAS tricked, and then have to worry about limiting the number of times you tell admins because of spams. The solution, really, is: not to tease the user in the first place. If they've exceeded the limit, just don't show the damn form! This simple change in methodology saves a healthy bit of code (and a lot of useless watchdog messages).

AttachmentSize
p_239751_throttle.patch 4.44 KB

#2

SeanA - April 16, 2008 - 19:33

Definitely a more sensible place to check the submission limit.

One little suggestion. Since previous submissions are tracked by IP address, users who have reached the submit limit and are currently logged out will still see "You may not submit another entry at this time," which might be confusing. That message should probably only be shown to logged in users.

#3

Crell - April 29, 2008 - 07:15

I was just bitten by this as well. Subscribing so I can test the patch when it's not 2 am.

#4

quicksketch - May 27, 2008 - 20:46
Status:needs review» fixed

I consolidated the error messages thrown during validation into a single message if multiple are thown. So that if you have both the error message "You cannot submit another entry at this time" and "You have already submitted this form. View your submissions", it is consolidated into "You cannot submit another entry at this time. View your submissions." This just cuts down on redundant error messages.

Other than that, the patch worked great. Sorry for the long delay before getting this in. I wanted to get the 2.0 version out the door before introducing any new features. This will be included in the 2.1 version.

#5

Anonymous (not verified) - June 10, 2008 - 21:02
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.