I'm seeing an apparent bug with this module that's very similar to http://drupal.org/node/1480568, and started when jQuery Update was installed. I've noticed other issues mentioning it's not compatible with jQuery Update, but I'd appreciate some better understanding as to why (or whether that's even still true..).

I'm using jQuery Update -dev (to select version 1.7), webform 3.x (latest), and the 1.7 version of Options Element. The dev site I'm working with has little else going on, so this should be reproducible on a basic test site (I'll try to confirm this myself tonight or tomorrow). When adding a new "Select Options" component (or editing an existing one, after installing jQuery Update), the options textfields are disabled.

I did find one place in options_element.js that was using '' in lieu of 'false', but changing this didn't help matters. In fact, it seems as though the prototype.disable function is always called when the page loads, but I can't tell why. Anyone have insights here?

Comments

spiderman’s picture

I've just confirmed this on a stock D7 install, and it definitely happens as soon as I set JQuery Update to use version 1.7 of JQuery

Steps to reproduce:

1. drush site-install (Drupal 7.14 platform with http://drupal.org/files/d7-use_attr_with_false-1480568-23.patch applied to correct similar bug with core fields - see attached .make file)
2. drush en -y webform options_element jquery_update
3. drush vset -y --format=string jquery_update_jquery_version '1.7' # Configure jquery_update to use JQuery 1.7 (alt: admin/config/jquery_update)
4. Add a webform node, and attempt to create a "Select Options" component

For me, the options textfields are disabled, and inspecting the html source shows the element has the attribute disabled="disabled"

spiderman’s picture

StatusFileSize
new498 bytes

The aforementioned .make file :)

quicksketch’s picture

Thanks @spiderman, appreciate the report and detailed instructions. This sounds really similar to #1513894: Pre-built options lists do not work with Options Element, are you sure it's not a problem caused by using Pre-built select lists? That patch has been committed but it's not in a stable release.

spiderman’s picture

Hi @quicksketch, thanks for the tip- yes, indeed that may be the issue. I'd seen that report earlier, but because our issue seemed to be triggered only by the presence of jquery_update (and 1.7 specifically), was assuming it was not relevant. I'll try to reproduce on the latest -dev snapshot (unless someone beats me to it!) and report back :)

sdragnev’s picture

I can confirm running into the same problem and the 1513894 patch (in #6) doesn't fix it for me.

The issue happens right off the bat when creating a new form with a select options field - it seems unrelated to pre-built select lists.

quicksketch’s picture

@stan.d and you're also running jQuery Update to jQuery 1.7? Does the problem go away when you turn off that module?

sdragnev’s picture

That's correct - jQuery Update was set to use 1.7. Disabling the module fixes the problem. Changing the version down to 1.5 fixes it as well.

k_’s picture

Confirming the issue with:

 Core                                 System (system)                                                       Module  Enabled        7.15                  
 Other                                Options element (options_element)                                     Module  Enabled        7.x-1.7               
 User interface                       jQuery Update (jquery_update)                                         Module  Enabled        7.x-2.1+9-dev         
 Webform                              Webform (webform)                                                     Module  Enabled        7.x-4.0-alpha4        

and jquery_update version set to 1.7.

Disabling any of the above is not an option here. Other than hardcoding in a DIY SelectList, is there a current workaround?

Any more information needed from us to help narrow this down?

k_’s picture

It may be obvious, but not explcitly mentioned, this mis-behvaior also occurs with 'radios' & 'checkboxes' elements. Everything with a definable/editable list seem to be affected.

Rob T’s picture

I also encountered this issue. I went to edit a webform component (a department select box), and the options were grayed out. Once I disabled the jquery update module, I was able to edit the component option value as expected.

quicksketch’s picture

Status: Active » Fixed
StatusFileSize
new799 bytes

This problem is caused by an API change in jQuery 1.6 and higher: http://api.jquery.com/prop/

Essentially the behavior of the $.attr() method changed. Previously it would return boolean false if an attribute was empty. Now it returns undefined. In order to support both pre and post jQuery 1.6, we apparently have to check if the new replacement method exists, $.prop().

This patch fixes the issue with jQuery update, which uses jQuery 1.7 and is affected by this API change. It continues to use the old approach for versions of jQuery prior to 1.6. Committed to D6 and D7 branch.

Status: Fixed » Closed (fixed)

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