You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Drupal\ui_patterns\Form\PatternDisplayFormTrait::buildPatternDisplayForm() we explicitly assign an 'id' attribute to the $form['pattern'] select element as follows:
'#attributes' => ['id' => 'patterns-select'],
and subsequently attach #states behaviours using this same hard-coded 'patterns-select' ID:
Bug description
In
Drupal\ui_patterns\Form\PatternDisplayFormTrait::buildPatternDisplayForm()
we explicitly assign an 'id' attribute to the$form['pattern']
select element as follows:and subsequently attach #states behaviours using this same hard-coded 'patterns-select' ID:
This means placing more than one pattern select on a given form leads to invalid HTML and broken #states.
Use case
An example use case is in the UI Patterns Blocks module, see the issue Support sub-patterns for block .
Proposed fix
Use
Html::getUniqueId()
to generate a unique ID value and use that in the'#states'
values.The text was updated successfully, but these errors were encountered: