I'm using a subtheme of the latest bootstrap 3.x dev branch and the 7.x-4.0-beta3 version of Webform, when enabling "Other" on a select list in a webform I get the following errors:

Notice: Undefined index: #type in _bootstrap_process_input() (line 91 of /sites/all/themes/bootstrap/theme/process.inc).
Notice: Undefined index: class in theme_webform_element() (line 3283 of /sites/all/modules/contrib/webform/webform.module).
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in theme_webform_element() (line 3283 of /sites/all/modules/contrib/webform/webform.module).

This is all caused by the unset($element['#type']); call in select_or_other_element_process(), commenting out this removes all errors (I believe the class index is set up in a webform process hook but doesn't work for elements with no type). It also seems to still work as expected, what was the purpose of this line? Patch attached to remove it.

Comments

acbramley’s picture

StatusFileSize
new502 bytes

Oops

skadu’s picture

Patch seems to work just fine for me as well. Using Bootstrap 3.

I would like to understand why the type was unset.

Thanks for patching this up.

torotil’s picture

Status: Needs review » Reviewed & tested by the community

This throws errors in form_builder too. Unsetting it's #type is a rather unique feature of select_or_other. Since there is no comment in the code explaining why this was added I'd vote for removing it too.

legolasbo’s picture

Status: Reviewed & tested by the community » Fixed

The unset($element['#type']); has been around (and uncommented) since the initial commit. I don't know why it is/was put in, but I guess it had something to do with Drupal 6's form handling.

Removing it seems a good plan, because it feels a bit hacky. If any bugs appear because of removing it, we'll deal with them in an appropriate manner.

Thanks for the patch!

Status: Fixed » Closed (fixed)

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