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 |
Jump to:
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.
| Attachment | Size |
|---|---|
| fix_limit.patch | 406 bytes |

#1
#2
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
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
Automatically closed -- issue fixed for two weeks with no activity.