diff -u b/core/includes/form.inc b/core/includes/form.inc --- b/core/includes/form.inc +++ b/core/includes/form.inc @@ -1697,6 +1697,13 @@ // tableselect element behaves as if it had been of #type checkboxes or // radios. foreach (element_children($element) as $key) { + // Since the #parents of the tableselect form element will equal the + // #parents of the row element, prevent FormBuilder from auto-generating + // an #id for the row element, so as to prevent drupal_html_id() from + // automatically appending a suffix. + $element_parents = array_merge($element['#parents'], array($key)); + $element[$key]['#id'] = drupal_html_id('edit-' . implode('-', $element_parents) . '-row'); + // Do not overwrite manually created children. if (!isset($element[$key]['select'])) { // Determine option label; either an assumed 'title' column, or the @@ -1734,15 +1741,9 @@ '#return_value' => $key, '#attributes' => $element['#attributes'], ); - $element_parents = array_merge($element['#parents'], array($key)); if ($element['#multiple']) { $element[$key]['select']['#default_value'] = isset($value[$key]) ? $key : NULL; $element[$key]['select']['#parents'] = $element_parents; - // Since #parents equals the #parents of the row element and - // FormBuilder auto-generates an #id for every element, ensure to - // suffix the checkbox #id with '-select', so as to prevent - // drupal_html_id() from automatically appending a suffix. - $element[$key]['select']['#id'] = drupal_html_id('edit-' . implode('-', $element_parents) . '-select'); } else { $element[$key]['select']['#default_value'] = ($element['#default_value'] == $key ? $key : NULL); diff -u b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php --- b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestTestForm.php @@ -147,7 +147,7 @@ // Cycle through each test within the current group. foreach ($tests as $class => $info) { $test_id = drupal_clean_id_identifier($class); - $test_checkbox_id = 'edit-' . $test_id . '-select'; + $test_checkbox_id = 'edit-' . $test_id; $current_js['testNames'][] = $test_checkbox_id; $form['tests']['table'][$test_id] = array(