diff -u b/core/lib/Drupal/Component/Utility/Html.php b/core/lib/Drupal/Component/Utility/Html.php
--- b/core/lib/Drupal/Component/Utility/Html.php
+++ b/core/lib/Drupal/Component/Utility/Html.php
@@ -22,24 +22,11 @@
protected static $classes = array();
/**
- * An array of the initial IDs used in one request.
- *
- * @var array
- */
- protected static $seenIdsInit;
-
- /**
- * An array of IDs, including incremented versions when an ID is duplicated.
- * @var array
- */
- protected static $seenIds;
-
- /**
- * Contains the current AJAX HTML IDs.
+ * A random string added to ids to ensure uniqueness.
*
* @var string
*/
- protected static $ajaxHTMLIDs;
+ protected static $request_nonce;
/**
* Prepares a string for use as a valid class name.
@@ -130,16 +117,14 @@
* The cleaned ID.
*/
public static function getUniqueId($id) {
- $request_nonce = &drupal_static(__FUNCTION__ . ':nonce');
- if (!isset($request_nonce)) {
+ if (!isset(static::$request_nonce)) {
// @todo The hash should not change for sub-requests, so it is not clear
// whether relying on the Request object is appropriate. Verify this,
// once there are sub-requests in core.
- $request_nonce = uniqid();
+ static::$request_nonce = uniqid();
}
- $id .= '-' . $request_nonce;
- return Html::getId($id);
+ return Html::getId($id) . '-' . static::$request_nonce;
}
/**