Hello,

I am using the latest version of Webform 6.x-3.6 and Select (or other) 6.x-2.4

On a basic webform node, I created a multiple select field (required) with 5 options and a select (or other) enabled.

There is another file upload field that is required.

If I submit the form with all of the options checked off in the first multiple select field but forget to upload a file (failed mandatory verification) then I am returned to the form with all of my select options retained except for the first select option (key 0) of the multiple select field.

This is consistent on all webforms created with the other field enabled via select (or other).

The expected behavior is that all selections are retained (including the first selection option of key 0).

-Chris

CommentFileSizeAuthor
#3 select_or_other_checkboxes.patch2.67 KBquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

danielb’s picture

Project: Select (or other) » Webform
Version: 6.x-2.4 » 6.x-3.6

Assigning to Webform 6.x-3.6.
If there is anything Select (or other) must change to accommodate a fix, please let me know.

quicksketch’s picture

Title: Error on Mandatory Verification clears out first select checkbox of multiple select field » Any validation error clears out "0" value checkboxes
Project: Webform » Select (or other)
Version: 6.x-3.6 » 6.x-2.x-dev

I've tried to reproduce this issue on the latest CVS versions of Webform and Select or Other... and it does indeed seem that this problem only occurs with Select or Other. Most likely the Select or Other form element doesn't properly handle checkboxes that have a value of "0" (which isn't surprising since this is a super-tweaky problem to solve correctly). I'll see if I can figure out what causes this and submit a patch, my guess is that this probably isn't specific to Webform at all, but affects everywhere Select or Other is used as checkboxes with a return value of "0".

quicksketch’s picture

Status: Active » Needs review
FileSize
2.67 KB

Here's a patch that includes the same collection of modifications Webform includes to make it so that Select or Other can handle checkboxes with a "value" property of "0". Drupal core is super-glitchy in this regard.

danielb’s picture

awesome quicksketch, thanks for that!

danielb’s picture

Status: Needs review » Fixed

committed, will appear in next dev snapshot

Status: Fixed » Closed (fixed)

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

  • Commit fbc6ede on 6.x-2.x, 7.x-3.x, 8.x-3.x by danielb:
    issues #946532, #1061734, #1066054