Issue #3503878: TypeError when having exposed form in block and setting "role" attribute on it
3 unresolved threads
Closes #3503878
Merge request reports
Activity
added 1 commit
changed this file in version 5 of the diff
98 99 } 99 100 } 100 101 102 /** 103 * Implements hook_form_alter(). 104 */ 105 #[Hook('form_alter')] 106 public function formAlter(&$form, FormStateInterface $form_state, $form_id): void { 107 if (\Drupal::state()->get('views_test_config_form_alter')) { This should use key/value rather than state per https://www.drupal.org/project/drupal/issues/3506148
141 141 142 142 // Proactively add aria-describedby if possible to improve accessibility. 143 143 if ($variables['label'] && isset($variables['attributes']['role'])) { 144 $variables['title_attributes']['id'] = Html::getUniqueId($variables['label']); 144 $label = $variables['label']; 145 // If the label is an array, render it to a string. 146 if (is_array($label)) {
Please register or sign in to reply