Limit to submissions, strange default behaviour

surge_martin - March 30, 2008 - 13:35
Project:Webform
Version:5.x-2.0-beta2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

The way the defaults are set (enforce limits, empty submit limit) it seems to have the net effect of a limit of one per user, because a zero is written to the db for submit_limit.

From what I can see, the problem seems to be that the logic depends on submit_limit needing to be set to -1. Personally, I think logically if the submit limit is zero (or left blank) that should be equivalent to switching to enforce_limit to off (-1). Currently a zero (or blank) results in a true value being returned from _webform_submission_limit_check, which effectively means that a user can only submit once.

I've attached a patch which should fix this.

AttachmentSize
fix_limit.patch406 bytes

#1

surge_martin - March 30, 2008 - 13:49
Title:Limit to submissions, strange defaults» Limit to submissions, strange default behaviour
Status:active» patch (code needs review)

#2

quicksketch - March 31, 2008 - 20:48

Thanks, I already fixed the problem that made this problem apparent. -1 is supposed to be the default (unlimited) not 0. However, this brings up the problem that the value of 0 is not handled properly. "0 submissions ever" should essentially prevent further submissions of the form, though currently it's treated the same as 1 submission ever.

I'm going to wait on fixing this particular problem though until after http://drupal.org/node/239343, since they overlap in code.

#3

quicksketch - May 31, 2008 - 22:44
Status:patch (code needs review)» fixed

An easy fix: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/webform/web...

A submission limit of '0' now effectively disables further submissions, rather than allowing a single submission.

#4

Anonymous (not verified) - June 14, 2008 - 22:52
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.