Closed (fixed)
Project:
Webform
Version:
6.x-3.0
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Aug 2010 at 11:35 UTC
Updated:
14 Mar 2011 at 16:37 UTC
Jump to comment: Most recent file
hey guys,
after some testing of webform 3.0 i run into a bug. i a user checkes the first option of a select list, this choosen option is not saved nor emailed.
can anybody help pls.?
thanks
steffen
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | webform_zero_checkboxes.patch | 5.64 KB | quicksketch |
| #8 | webform_zero_checkboxes7.patch | 3.97 KB | quicksketch |
| #1 | Unbenannt-2.jpg | 33.44 KB | drizzi |
Comments
Comment #1
drizzi commentedComment #2
drizzi commentedi added a printscreen; a selected "HipHop" or "Kurs" nevers shows up in the email or saved submissions
Comment #3
quicksketchThis sounds the same as #853706: select list safe_key "0" problem after upgrade to 6.x-3.0-beta6. Unfortunately I'm having a hard time reproducing the problem.
Comment #5
drizzi commentedhey quicksketch,
for me changing from 0 to 1, 1to 2, etc. did the trick..
thanks for the hint
steffen
Comment #6
quicksketchI should warn you though, if you change 0 to 1, you've changed all your results also (so any previous submissions that used to have the second choice now have the first one). If you don't use Webform for historical records that's fine, but changing 0 to 1 probably won't work for most users.
I'm still not able to reproduce this issue. Does the problem with 0 not being recorded occur on new forms for you, or is it just the ones that were upgraded?
Comment #7
quicksketchOkay, upon further testing I have been able to reproduce but only under these circumstances:
- The key of the first option must be "0" (actually it can be any item, not just the first one)
- This only affects checkboxes
- It also only affects checkboxes if you do not have the "Select or other..." option enabled on those checkboxes.
However it does affect all versions of Webform, not just upgrades. I'll have a look at this and should have it figured out shortly.
Comment #8
quicksketchThese patches correct the behavior in both versions of Webform. Drupal 7 has some specific problems regarding setting the value of checkboxes when going back and forth between pages, but I don't want to hold up a Drupal 6 fix because of pre-existing problems with Drupal 7.
While putting this together, I found out that our test for zero-value checkboxes wasn't working correctly. Now that I've fixed it we shouldn't run into this problem again.
Comment #9
tomsm commentedI just upgraded my live site from version 6.x-2.9 to 6.x-3.1.
I still have this issue, also see http://drupal.org/node/853706 (a duplicate of this issue).
The submitted value of the first item of a select list is always 0 when I review the result.
When I change the key value to 1 for example the item is correctly submitted.
I also use the webform validation module to verify if one of the checkboxes is selected. When I select the first option (zero as key value) the module prompts me that I have to select a value.
Comment #10
quicksketchAre you talking about a select list or checkboxes here? I don't quite understand what you mean by "the first item of a select list is always 0". You mean that a value of "0" is getting saved but it's not the right value? Could you provide a sample set of options that do not work?
This is probably a separate bug in Webform Validation. Since the checkboxes are submitting a value of "0", it's easy to accidentally not capture the value since in PHP "0" == FALSE == NULL.
Comment #11
quicksketchThere are several different issues regarding the first item being selected if the first item has a key of zero. Let's consolidate this new problem over in #885454: First item of select lists selected as default if no default is set.
Comment #12
tomsm commentedI submitted a Webform Validation issue about this:
http://drupal.org/node/886458
Comment #14
rantebi commentedIt looks like it's meant to be this way.
Here is a part from the drupal form api on "checkboxes":
taken from http://api.drupal.org/api/drupal/developer--topics--forms_api_reference....