After enabling "Allow cookies for tracking submissions" every user got an error about already having submitted the form on going to any webform, but no submissions existed. Users were using two different test systems, but users with all kinds of permissions and roles got the same errors.
On submitting any form, the screen was filled with errors, looked like one for every form component, about invalid arguments foreach()...webform.module for the line that gets the cid. The code from that area reads like this:
function webform_get_cid(&$node, $form_key, $pid) {
foreach ($node->webform['components'] as $cid => $component) {
if ($component['form_key'] == $form_key && $component['pid'] == $pid) {
return $cid;
}
}
}
Refreshing the page in the browser eliminated the errors about previous submissions and the submission errors. Removing the cookie tracking prevented all the errors. Is this something everyone experiences with this module?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | webform_cookie_check.patch | 2.02 KB | quicksketch |
Comments
Comment #1
wsmoomaw commentedIssue title should be corrected to webform.module. Sorry for the typo.
Comment #2
wsmoomaw commentedComment #3
quicksketchThanks, I've confirmed this bug. I'll look into it shortly.
Comment #4
quicksketch"Shortly" apparently means exactly one month :P
I found all sorts of problems with the cookie tracking, which apparently was never updated after we switched to displaying the "You've already submitted this form" error from being on submission to on page load. The result was that simply viewing the page caused the cookie to be set, and prevented the user from submitting the form. A very serious problem. On my test machine, I'd get weird problems where I could submit the form every-other page load.
To fix all of this, I've moved the cookie_set() code to the submission handler, and kept the cookie checking on page load. The attached patch should fix the problem and it'll be in the 2.2 release I plan to get out shortly (for real). In the mean time I'd suggest turning off the cookie option.
Comment #5
quicksketchUpdating title to reflect the more serious problem.
Comment #6
quicksketchAh, also, this patch is necessary on the webform.module file.
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/webform/web...
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.