Form elements are not added to the subform if #attributes[name] is explicitly set, because in that case, the explicit setting overrides the value in #name. You end up with the original name on the element instead of the subform-nested name. This problem arose in a multi-select field, which had #attributes[name] explicitly set.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cwgordon7’s picture

Status: Active » Needs review
FileSize
499 bytes

This patch fixes the problem.

cwgordon7’s picture

Sorry, this patch works better.

casey’s picture

Status: Needs review » Fixed

Thanks!

casey’s picture

Actually we should only overwrite the #attributes[name]. If we overwrite #name theme_form_element will set classes prefixed with subform name. CSS and Javascript might however depend on those classes.

Hopefully this won't introduce other problems.

Status: Fixed » Closed (fixed)

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