diff -u b/core/lib/Drupal/Core/Field/WidgetBase.php b/core/lib/Drupal/Core/Field/WidgetBase.php --- b/core/lib/Drupal/Core/Field/WidgetBase.php +++ b/core/lib/Drupal/Core/Field/WidgetBase.php @@ -217,7 +217,7 @@ // Add 'add more' button, if not working with a programmed form. if ($cardinality == FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED && !$form_state->isProgrammed()) { $id_prefix = implode('-', array_merge($parents, array($field_name))); - $wrapper_id = HTML::getUniqueId($id_prefix . '-add-more-wrapper'); + $wrapper_id = Html::getUniqueId($id_prefix . '-add-more-wrapper'); $elements['#prefix'] = '
'; $elements['#suffix'] = '
'; diff -u b/core/lib/Drupal/Core/Render/Element/Link.php b/core/lib/Drupal/Core/Render/Element/Link.php --- b/core/lib/Drupal/Core/Render/Element/Link.php +++ b/core/lib/Drupal/Core/Render/Element/Link.php @@ -8,6 +8,7 @@ namespace Drupal\Core\Render\Element; use Drupal\Component\Utility\NestedArray; +use Drupal\Component\Utility\Html; /** * Provides a link render element. @@ -69,7 +70,7 @@ if (isset($element['#ajax']) && !isset($element['#ajax_processed'])) { // If no HTML ID was found above, automatically create one. if (!isset($element['#id'])) { - $element['#id'] = $element['#options']['attributes']['id'] = \Drupal\Component\Utility\Html::getUniqueId('ajax-link'); + $element['#id'] = $element['#options']['attributes']['id'] = Html::getUniqueId('ajax-link'); } $element = static::preRenderAjaxForm($element); } diff -u b/core/lib/Drupal/Core/Render/Element/Radios.php b/core/lib/Drupal/Core/Render/Element/Radios.php --- b/core/lib/Drupal/Core/Render/Element/Radios.php +++ b/core/lib/Drupal/Core/Render/Element/Radios.php @@ -8,6 +8,7 @@ namespace Drupal\Core\Render\Element; use Drupal\Core\Form\FormStateInterface; +use Drupal\Component\Utility\Html; /** * Provides a form element for a set of radio buttons. @@ -65,7 +66,7 @@ '#default_value' => isset($element['#default_value']) ? $element['#default_value'] : FALSE, '#attributes' => $element['#attributes'], '#parents' => $element['#parents'], - '#id' => \Drupal\Component\Utility\Html::getUniqueId('edit-' . implode('-', $parents_for_id)), + '#id' => Html::getUniqueId('edit-' . implode('-', $parents_for_id)), '#ajax' => isset($element['#ajax']) ? $element['#ajax'] : NULL, '#weight' => $weight, ); diff -u b/core/lib/Drupal/Core/Render/Element/Table.php b/core/lib/Drupal/Core/Render/Element/Table.php --- b/core/lib/Drupal/Core/Render/Element/Table.php +++ b/core/lib/Drupal/Core/Render/Element/Table.php @@ -9,6 +9,7 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\Element; +use Drupal\Component\Utility\Html; /** * Provides a render element for a table. @@ -134,7 +135,7 @@ // an #id for the row element, since // \Drupal\Component\Utility\Html::getUniqueId() would automatically // append a suffix to the tableselect form element's #id otherwise. - $row['#id'] = \Drupal\Component\Utility\Html::getUniqueId('edit-' . implode('-', $element_parents) . '-row'); + $row['#id'] = Html::getUniqueId('edit-' . implode('-', $element_parents) . '-row'); // Do not overwrite manually created children. if (!isset($row['select'])) { @@ -172,7 +173,7 @@ $row = array('select' => array()) + $row; $row['select'] += array( '#type' => $element['#multiple'] ? 'checkbox' : 'radio', - '#id' => \Drupal\Component\Utility\Html::getUniqueId('edit-' . implode('-', $element_parents)), + '#id' => Html::getUniqueId('edit-' . implode('-', $element_parents)), // @todo If rows happen to use numeric indexes instead of string keys, // this results in a first row with $key === 0, which is always FALSE. '#return_value' => $key, diff -u b/core/lib/Drupal/Core/Render/Element/Tableselect.php b/core/lib/Drupal/Core/Render/Element/Tableselect.php --- b/core/lib/Drupal/Core/Render/Element/Tableselect.php +++ b/core/lib/Drupal/Core/Render/Element/Tableselect.php @@ -9,6 +9,7 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\Element; +use Drupal\Component\Utility\Html; /** * Provides a form element for a table with radios or checkboxes in left column. @@ -236,7 +237,7 @@ '#default_value' => ($element['#default_value'] == $key) ? $key : NULL, '#attributes' => $element['#attributes'], '#parents' => $element['#parents'], - '#id' => \Drupal\Component\Utility\Html::getUniqueId('edit-' . implode('-', $parents_for_id)), + '#id' => Html::getUniqueId('edit-' . implode('-', $parents_for_id)), '#ajax' => isset($element['#ajax']) ? $element['#ajax'] : NULL, ); }