1. Install and enable Webform and Options Element.
2. Create a Webform adding a 'Select options' component.
3. Choose a pre-built options list.
4. Save the component.
5. Edit the component.

The various settings for the options are disabled. They should be enabled. If Options Element is disabled, there is no problem. The problem exists whether or not JavaScript is enabled, so the problem is not there.

This is probably related in some way to #1493894: Notice: Undefined index: options_text in _form_options_validate() (Default values in Options Elements not editable).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

The various settings for the options are disabled.

The settings for options are supposed to be disabled if you're using a pre-built list, since that list is being provided by code. If you want to edit the list, you can pre-fill the list by selecting a pre-built list, then changing it back to "None". Then you can edit the options but they'll no longer be provided through code.

Liam Morland’s picture

I can't change it back to None; that setting is disabled. So is "customize keys" and the other settings in the Options fieldset.

quicksketch’s picture

Oh, yep you're quite correct. I think this is Webform having this effect. Everything works fine while you're editing the component like it's intended (you can see the list and set a default, but not change the values or order), but after saving and re-editing the component things go all wrong.

Liam Morland’s picture

Project: Options Element » Webform
Version: 7.x-1.7 » 7.x-3.x-dev
Status: Active » Needs review
FileSize
488 bytes

Thanks. The attached patch solves the issue. Everything seems to work properly. I like simple solutions!

Liam Morland’s picture

Title: Pre-built options lists do not work » Pre-built options lists do not work with Options Element
Liam Morland’s picture

One problem: The first solution allows the values to be edited when a pre-built list is selected, though the edits are not saved. The attached patch, which patches Options Element instead, produces the desired behavior, but I am not clear if it has unintended side-effects. Please review.

Liam Morland’s picture

Project: Webform » Options Element
Version: 7.x-3.x-dev » 7.x-1.7
quicksketch’s picture

Thanks Liam, does your latest patch in #6 replace the one in #4, or do they both need to be applied?

Liam Morland’s picture

Just #6 is needed.

quicksketch’s picture

Status: Needs review » Fixed

Thanks committed to both branches.

Liam Morland’s picture

Thanks. I'm not seeing the change when I do a git pull. Have you pushed it yet?

quicksketch’s picture

Sorry I hadn't pushed. Up now.

Status: Fixed » Closed (fixed)

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