Started getting warnings after upgrading to rc18 and tracked it down to this change:

http://drupalcode.org/viewvc/drupal/contributions/modules/ecommerce/ec_s...

The problem is that the theme('select') ends up in form_get_error, which expects $element['#parents'] to be set properly. As this select haven't been properly through the form builder, #parents haven't been set.

I don't quite get the idea behind this change, so I haven't attempted to make a patch.

Comments

gordon’s picture

Status: Active » Fixed

This is a special form field which is used by JS to allow users to select from a drop down list of states.

Since this can only work from within JS it is done so that it will degrade gracefully if JS is not enabled. I needed a select field which I can show when a country has a list of states. When any changes are made to the select list the original field which is hidden is updated with the new state code.

So given this I needed to do some funny stuff so that I would get a correctly rendered select field and the form api will not know about the field and have to work around the validation issues.

I have done some things to get around these errors if you want to give them a go.

Gordon

xen’s picture

That does remove the warning, but wouldn't it be more proper for the JS to generate a new select element and just hide the input element?

gordon’s picture

The main reason that get Drupal to generate the select element is so that when the select element is rendered it is rendered the same as the theme and will inherit all the same styling as the other select elements.

Status: Fixed » Closed (fixed)

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