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.

CommentFileSizeAuthor
fix_limit.patch406 bytesmandclu

Comments

mandclu’s picture

Title: Limit to submissions, strange defaults » Limit to submissions, strange default behaviour
Status: Active » Needs review
quicksketch’s picture

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.

quicksketch’s picture

Status: 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.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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