diff --git a/core/core.services.yml b/core/core.services.yml index 953c7c519f1d42242c6fdf7c05b3137bbdc32151..c2842a704021854622bf5311ab8f49247c45c946 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -1554,7 +1554,7 @@ services: class: Drupal\Core\Extension\InfoParser twig: class: Drupal\Core\Template\TwigEnvironment - arguments: ['@app.root', '@cache.default', '%twig_extension_hash%', '@twig.loader', '%twig.config%'] + arguments: ['@app.root', '@cache.default', '%twig_extension_hash%', '@state', '@twig.loader', '%twig.config%'] tags: - { name: service_collector, tag: 'twig.extension', call: addExtension } twig.extension: diff --git a/core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php b/core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php index e564fd087a4dde2ee8f56b7e641f0401411e1bfb..879f13b3c360ea8539b17eefeb9f167a9cfd32c5 100644 --- a/core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php +++ b/core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php @@ -10,6 +10,7 @@ use Doctrine\Common\Annotations\AnnotationRegistry; use Doctrine\Common\Reflection\StaticReflectionParser; use Drupal\Component\Plugin\Discovery\DiscoveryTrait; +use Drupal\Component\Utility\Crypt; /** * Defines a discovery mechanism to find annotated plugins in PSR-0 namespaces. @@ -74,7 +75,7 @@ function __construct($plugin_namespaces = array(), $plugin_definition_annotation $this->annotationNamespaces = $annotation_namespaces; $file_cache_suffix = str_replace('\\', '_', $plugin_definition_annotation_name); - $file_cache_suffix .= ':' . hash('crc32b', serialize($annotation_namespaces)); + $file_cache_suffix .= ':' . Crypt::hashBase64(serialize($annotation_namespaces)); $this->fileCache = FileCacheFactory::get('annotation_discovery:' . $file_cache_suffix); } diff --git a/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php b/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php index 984ec509bcfae23ff05d2971e7a73069c71fd278..76a43fd2a5138bc75cd8857e866652450127b3c5 100644 --- a/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php +++ b/core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php @@ -2,6 +2,7 @@ namespace Drupal\Component\DependencyInjection\Dumper; +use Drupal\Component\Utility\Crypt; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Parameter; @@ -373,7 +374,7 @@ protected function dumpCallable($callable) { protected function getPrivateServiceCall($id, Definition $definition, $shared = FALSE) { $service_definition = $this->getServiceDefinition($definition); if (!$id) { - $hash = hash('sha1', serialize($service_definition)); + $hash = Crypt::hashBase64(serialize($service_definition)); $id = 'private__' . $hash; } return (object) array( diff --git a/core/lib/Drupal/Core/Access/RouteProcessorCsrf.php b/core/lib/Drupal/Core/Access/RouteProcessorCsrf.php index ce0a2611ef39d9bc44a17dfe1fb25f00cbfcd2a1..d529c0cf784708ac2e2df90fc3abb4a0a3fe8af0 100644 --- a/core/lib/Drupal/Core/Access/RouteProcessorCsrf.php +++ b/core/lib/Drupal/Core/Access/RouteProcessorCsrf.php @@ -2,6 +2,7 @@ namespace Drupal\Core\Access; +use Drupal\Component\Utility\Crypt; use Drupal\Core\Render\BubbleableMetadata; use Drupal\Core\RouteProcessor\OutboundRouteProcessorInterface; use Symfony\Component\Routing\Route; @@ -45,7 +46,7 @@ public function processOutbound($route_name, Route $route, array &$parameters, B } else { // Generate a placeholder and a render array to replace it. - $placeholder = hash('sha1', $path); + $placeholder = Crypt::hashBase64($path); $placeholder_render_array = [ '#lazy_builder' => ['route_processor_csrf:renderPlaceholderCsrfToken', [$path]], ]; diff --git a/core/lib/Drupal/Core/Config/Development/ConfigSchemaChecker.php b/core/lib/Drupal/Core/Config/Development/ConfigSchemaChecker.php index 2ea20ff54cf11d4e91a07bb27d8733b4bb5c86df..e639966c2dae9e2c59b1bd037e5016c085b9502d 100644 --- a/core/lib/Drupal/Core/Config/Development/ConfigSchemaChecker.php +++ b/core/lib/Drupal/Core/Config/Development/ConfigSchemaChecker.php @@ -2,6 +2,7 @@ namespace Drupal\Core\Config\Development; +use Drupal\Component\Utility\Crypt; use Drupal\Component\Utility\SafeMarkup; use Drupal\Core\Config\ConfigCrudEvent; use Drupal\Core\Config\ConfigEvents; @@ -79,7 +80,7 @@ public function onConfigSave(ConfigCrudEvent $event) { $name = $saved_config->getName(); $data = $saved_config->get(); - $checksum = hash('crc32b', serialize($data)); + $checksum = Crypt::hashBase64(serialize($data)); if (!in_array($name, $this->exclude) && !isset($this->checked[$name . ':' . $checksum])) { $this->checked[$name . ':' . $checksum] = TRUE; $errors = $this->checkConfigSchema($this->typedManager, $name, $data); diff --git a/core/lib/Drupal/Core/DependencyInjection/Compiler/TwigExtensionPass.php b/core/lib/Drupal/Core/DependencyInjection/Compiler/TwigExtensionPass.php index d5c793199fd439cc4d63c950be34fc3c872dd9e9..73ee17b68aa9255b8652a0fb2e7ff7e595d941bb 100644 --- a/core/lib/Drupal/Core/DependencyInjection/Compiler/TwigExtensionPass.php +++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/TwigExtensionPass.php @@ -2,6 +2,7 @@ namespace Drupal\Core\DependencyInjection\Compiler; +use Drupal\Component\Utility\Crypt; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -26,7 +27,7 @@ public function process(ContainerBuilder $container) { $twig_extension_hash .= $class_name . filemtime($reflection->getFileName()); } - $container->setParameter('twig_extension_hash', hash('crc32b', $twig_extension_hash)); + $container->setParameter('twig_extension_hash', Crypt::hashBase64($twig_extension_hash)); } } diff --git a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php index 7097b85df3bf52c195411d3b76d217a55a1537a2..1b3e6c0fbbe1e3c301541f173cf0a17eb88fba9b 100644 --- a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php +++ b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php @@ -2,6 +2,7 @@ namespace Drupal\Core\Entity; +use Drupal\Component\Utility\Crypt; use Drupal\Core\Cache\Cache; use Drupal\Core\Entity\Display\EntityViewDisplayInterface; use Drupal\Core\Entity\Entity\EntityViewDisplay; @@ -462,7 +463,7 @@ protected function getSingleFieldDisplay($entity, $field_name, $display_options) // series of fields individually for cases such as views tables. $entity_type_id = $entity->getEntityTypeId(); $bundle = $entity->bundle(); - $key = $entity_type_id . ':' . $bundle . ':' . $field_name . ':' . hash('crc32b', serialize($display_options)); + $key = $entity_type_id . ':' . $bundle . ':' . $field_name . ':' . Crypt::hashBase64(serialize($display_options)); if (!isset($this->singleFieldDisplays[$key])) { $this->singleFieldDisplays[$key] = EntityViewDisplay::create(array( 'targetEntityType' => $entity_type_id, diff --git a/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php index 878967b9c914f7e3f07f7a78004a30e0fba65128..803b4f1c57a88950eaee8475896df675694bb07b 100644 --- a/core/lib/Drupal/Core/Form/FormBuilder.php +++ b/core/lib/Drupal/Core/Form/FormBuilder.php @@ -683,8 +683,9 @@ public function prepareForm($form_id, &$form, FormStateInterface &$form_state) { // will be replaced at the very last moment. This ensures forms with // dynamically generated action URLs don't have poor cacheability. // Use the proper API to generate the placeholder, when we have one. See - // https://www.drupal.org/node/2562341. - $placeholder = 'form_action_' . hash('crc32b', __METHOD__); + // https://www.drupal.org/node/2562341. The placholder uses a fixed string + // that is Crypt::hashBase64('Drupal\Core\Form\FormBuilder::prepareForm'); + $placeholder = 'form_action_p_pvdeGsVG5zNF_XLGPTvYSKCf43t8qZYSwcfZl2uzM'; $form['#attached']['placeholders'][$placeholder] = [ '#lazy_builder' => ['form_builder:renderPlaceholderFormAction', []], @@ -744,7 +745,7 @@ public function prepareForm($form_id, &$form, FormStateInterface &$form_state) { if ($user && $user->isAuthenticated()) { // Generate a public token based on the form id. // Generates a placeholder based on the form ID. - $placeholder = 'form_token_placeholder_' . hash('crc32b', $form_id); + $placeholder = 'form_token_placeholder_' . Crypt::hashBase64($form_id); $form['#token'] = $placeholder; $form['form_token'] = array( diff --git a/core/lib/Drupal/Core/Render/PlaceholderGenerator.php b/core/lib/Drupal/Core/Render/PlaceholderGenerator.php index 488ab8812b4a92d005d1407330f86eee12803974..fad8cf745043cdf834205956a02a5e3cf654739d 100644 --- a/core/lib/Drupal/Core/Render/PlaceholderGenerator.php +++ b/core/lib/Drupal/Core/Render/PlaceholderGenerator.php @@ -2,6 +2,7 @@ namespace Drupal\Core\Render; +use Drupal\Component\Utility\Crypt; use Drupal\Component\Utility\Html; use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Cache\Cache; @@ -84,7 +85,7 @@ public function createPlaceholder(array $element) { // debugging. $callback = $placeholder_render_array['#lazy_builder'][0]; $arguments = UrlHelper::buildQuery($placeholder_render_array['#lazy_builder'][1]); - $token = hash('crc32b', serialize($placeholder_render_array)); + $token = Crypt::hashBase64(serialize($placeholder_render_array)); $placeholder_markup = ''; // Build the placeholder element to return. diff --git a/core/lib/Drupal/Core/Template/TwigEnvironment.php b/core/lib/Drupal/Core/Template/TwigEnvironment.php index fe391d8ed58e6bee4cb8019409cc07882e84ee82..f5ee4597675d0170d682db9b0356be38b909a5ef 100644 --- a/core/lib/Drupal/Core/Template/TwigEnvironment.php +++ b/core/lib/Drupal/Core/Template/TwigEnvironment.php @@ -4,6 +4,7 @@ use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Render\Markup; +use Drupal\Core\State\StateInterface; /** * A class that defines a Twig environment for Drupal. @@ -22,6 +23,8 @@ class TwigEnvironment extends \Twig_Environment { */ protected $templateClasses; + protected $twigCachePrefix = ''; + /** * Constructs a TwigEnvironment object and stores cache and storage * internally. @@ -32,12 +35,14 @@ class TwigEnvironment extends \Twig_Environment { * The cache bin. * @param string $twig_extension_hash * The Twig extension hash. + * @param \Drupal\Core\State\StateInterface $state + * The state service. * @param \Twig_LoaderInterface $loader * The Twig loader or loader chain. * @param array $options * The options for the Twig environment. */ - public function __construct($root, CacheBackendInterface $cache, $twig_extension_hash, \Twig_LoaderInterface $loader = NULL, $options = array()) { + public function __construct($root, CacheBackendInterface $cache, $twig_extension_hash, StateInterface $state, \Twig_LoaderInterface $loader = NULL, $options = array()) { // Ensure that twig.engine is loaded, given that it is needed to render a // template because functions like TwigExtension::escapeFilter() are called. require_once $root . '/core/themes/engines/twig/twig.engine'; @@ -58,13 +63,35 @@ public function __construct($root, CacheBackendInterface $cache, $twig_extension $this->addExtension($sandbox); if ($options['cache'] === TRUE) { - $options['cache'] = new TwigPhpStorageCache($cache, $twig_extension_hash); + $current = $state->get('twig_extension_hash_prefix', ['twig_extension_hash' => '']); + if ($current['twig_extension_hash'] !== $twig_extension_hash || empty($current['twig_cache_prefix'])) { + $current = [ + 'twig_extension_hash' => $twig_extension_hash, + // Generate a new prefix which invalidates any existing cached files. + 'twig_cache_prefix' => uniqid(), + + ]; + $state->set('twig_extension_hash_prefix', $current); + } + $this->twigCachePrefix = $current['twig_cache_prefix']; + + $options['cache'] = new TwigPhpStorageCache($cache, $this->twigCachePrefix); } $this->loader = $loader; parent::__construct($this->loader, $options); } + /** + * Get the cache prefixed used by \Drupal\Core\Template\TwigPhpStorageCache + * + * @return string + * The file cache prefix, or empty string if the cache is disabled. + */ + public function getTwigCachePrefix() { + return $this->twigCachePrefix; + } + /** * Gets the template class associated with the given string. * diff --git a/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php b/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php index b9f7cae3c14dde8da197fd1db42f6827084bd08f..f99f8c5a42971b5c76e541eb30d249e5c0fd758f 100644 --- a/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php +++ b/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php @@ -43,12 +43,12 @@ class TwigPhpStorageCache implements \Twig_CacheInterface { * * @param \Drupal\Core\Cache\CacheBackendInterface $cache * The cache bin. - * @param string $twig_extension_hash - * The Twig extension hash. + * @param string $twig_cache_prefix + * A Twig cache file prefix that changes when Twig extensions change. */ - public function __construct(CacheBackendInterface $cache, $twig_extension_hash) { + public function __construct(CacheBackendInterface $cache, $twig_cache_prefix) { $this->cache = $cache; - $this->templateCacheFilenamePrefix = $twig_extension_hash; + $this->templateCacheFilenamePrefix = $twig_cache_prefix; } /** diff --git a/core/lib/Drupal/Core/TypedData/TypedDataManager.php b/core/lib/Drupal/Core/TypedData/TypedDataManager.php index 49041501510b9f522c8d5f41807f0ae79ea1967d..b1c295d00e48a11f7a350e4a8d35014f4a76f530 100644 --- a/core/lib/Drupal/Core/TypedData/TypedDataManager.php +++ b/core/lib/Drupal/Core/TypedData/TypedDataManager.php @@ -158,9 +158,9 @@ public function getPropertyInstance(TypedDataInterface $object, $property_name, // Root data type and settings. $parts[] = $root_definition->getDataType(); if ($settings = $root_definition->getSettings()) { - // Hash the settings into a string. crc32 is the fastest way to hash - // something for non-cryptographic purposes. - $parts[] = hash('crc32b', serialize($settings)); + // Include the settings serialized as JSON as part of the key. The JSON is + // a shorter string than the serialized form, so array access is faster. + $parts[] = json_encode($settings); } // Property path for the requested data object. When creating a list item, // use 0 in the key as all items look the same. diff --git a/core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php b/core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php index 91ad604b49a4f2515fef1d83493bf96f7e939387..8fe3e97a8b6a26986f39cec4feef8b61a1e10519 100644 --- a/core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php +++ b/core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php @@ -2,6 +2,7 @@ namespace Drupal\big_pipe\Render\Placeholder; +use Drupal\Component\Utility\Crypt; use Drupal\Component\Utility\Html; use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Render\Placeholder\PlaceholderStrategyInterface; @@ -260,7 +261,7 @@ protected static function generateBigPipePlaceholderId($original_placeholder, ar if (isset($placeholder_render_array['#lazy_builder'])) { $callback = $placeholder_render_array['#lazy_builder'][0]; $arguments = $placeholder_render_array['#lazy_builder'][1]; - $token = hash('crc32b', serialize($placeholder_render_array)); + $token = Crypt::hashBase64(serialize($placeholder_render_array)); return UrlHelper::buildQuery(['callback' => $callback, 'args' => $arguments, 'token' => $token]); } // When the placeholder's render array is not using a #lazy_builder, diff --git a/core/modules/big_pipe/src/Tests/BigPipePlaceholderTestCases.php b/core/modules/big_pipe/src/Tests/BigPipePlaceholderTestCases.php index d2db3cb72cec2395513ca66dde41454aa76b84ff..0a674e05df9808c1945443e1707b8ff92cb6a947 100644 --- a/core/modules/big_pipe/src/Tests/BigPipePlaceholderTestCases.php +++ b/core/modules/big_pipe/src/Tests/BigPipePlaceholderTestCases.php @@ -51,7 +51,7 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf // 1. Real-world example of HTML placeholder. $status_messages = new BigPipePlaceholderTestCase( ['#type' => 'status_messages'], - '', + '', [ '#lazy_builder' => [ 'Drupal\Core\Render\Element\StatusMessages::renderMessages', @@ -59,29 +59,29 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf ], ] ); - $status_messages->bigPipePlaceholderId = 'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&args[0]&token=a8c34b5e'; + $status_messages->bigPipePlaceholderId = 'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&args[0]&token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA'; $status_messages->bigPipePlaceholderRenderArray = [ - '#markup' => '
', + '#markup' => '
', '#cache' => $cacheability_depends_on_session_and_nojs_cookie, '#attached' => [ 'library' => ['big_pipe/big_pipe'], 'drupalSettings' => [ 'bigPipePlaceholderIds' => [ - 'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&args[0]&token=a8c34b5e' => TRUE, + 'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&args[0]&token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA' => TRUE, ], ], 'big_pipe_placeholders' => [ - 'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&args[0]&token=a8c34b5e' => $status_messages->placeholderRenderArray, + 'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&args[0]&token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA' => $status_messages->placeholderRenderArray, ], ], ]; - $status_messages->bigPipeNoJsPlaceholder = '
'; + $status_messages->bigPipeNoJsPlaceholder = '
'; $status_messages->bigPipeNoJsPlaceholderRenderArray = [ - '#markup' => '
', + '#markup' => '
', '#cache' => $cacheability_depends_on_session_and_nojs_cookie, '#attached' => [ 'big_pipe_nojs_placeholders' => [ - '
' => $status_messages->placeholderRenderArray, + '
' => $status_messages->placeholderRenderArray, ], ], ]; @@ -109,7 +109,7 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf [ 'command' => 'insert', 'method' => 'replaceWith', - 'selector' => '[data-big-pipe-placeholder-id="callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&args[0]&token=a8c34b5e"]', + 'selector' => '[data-big-pipe-placeholder-id="callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&args[0]&token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA"]', 'data' => "\n" . ' ' . "\n ", 'settings' => NULL, ], @@ -267,29 +267,29 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf '#lazy_builder' => ['\Drupal\big_pipe_test\BigPipeTestController::exception', ['llamas', 'suck']], '#create_placeholder' => TRUE, ], - '', + '', [ '#lazy_builder' => ['\Drupal\big_pipe_test\BigPipeTestController::exception', ['llamas', 'suck']], ] ); - $exception->bigPipePlaceholderId = 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&args[0]=llamas&args[1]=suck&token=68a75f1a'; + $exception->bigPipePlaceholderId = 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&args[0]=llamas&args[1]=suck&token=uhKFNfT4eF449_W-kDQX8E5z4yHyt0-nSHUlwaGAQeU'; $exception->bigPipePlaceholderRenderArray = [ - '#markup' => '
', + '#markup' => '
', '#cache' => $cacheability_depends_on_session_and_nojs_cookie, '#attached' => [ 'library' => ['big_pipe/big_pipe'], 'drupalSettings' => [ 'bigPipePlaceholderIds' => [ - 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&args[0]=llamas&args[1]=suck&token=68a75f1a' => TRUE, + 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&args[0]=llamas&args[1]=suck&token=uhKFNfT4eF449_W-kDQX8E5z4yHyt0-nSHUlwaGAQeU' => TRUE, ], ], 'big_pipe_placeholders' => [ - 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&args[0]=llamas&args[1]=suck&token=68a75f1a' => $exception->placeholderRenderArray, + 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&args[0]=llamas&args[1]=suck&token=uhKFNfT4eF449_W-kDQX8E5z4yHyt0-nSHUlwaGAQeU' => $exception->placeholderRenderArray, ], ], ]; $exception->embeddedAjaxResponseCommands = NULL; - $exception->bigPipeNoJsPlaceholder = '
'; + $exception->bigPipeNoJsPlaceholder = '
'; $exception->bigPipeNoJsPlaceholderRenderArray = [ '#markup' => $exception->bigPipeNoJsPlaceholder, '#cache' => $cacheability_depends_on_session_and_nojs_cookie, @@ -307,29 +307,29 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf '#lazy_builder' => ['\Drupal\big_pipe_test\BigPipeTestController::responseException', []], '#create_placeholder' => TRUE, ], - '', + '', [ '#lazy_builder' => ['\Drupal\big_pipe_test\BigPipeTestController::responseException', []], ] ); - $embedded_response_exception->bigPipePlaceholderId = 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&&token=2a9bd022'; + $embedded_response_exception->bigPipePlaceholderId = 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&&token=PxOHfS_QL-T01NjBgu7Z7I04tIwMp6La5vM-mVxezbU'; $embedded_response_exception->bigPipePlaceholderRenderArray = [ - '#markup' => '
', + '#markup' => '
', '#cache' => $cacheability_depends_on_session_and_nojs_cookie, '#attached' => [ 'library' => ['big_pipe/big_pipe'], 'drupalSettings' => [ 'bigPipePlaceholderIds' => [ - 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&&token=2a9bd022' => TRUE, + 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&&token=PxOHfS_QL-T01NjBgu7Z7I04tIwMp6La5vM-mVxezbU' => TRUE, ], ], 'big_pipe_placeholders' => [ - 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&&token=2a9bd022' => $embedded_response_exception->placeholderRenderArray, + 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&&token=PxOHfS_QL-T01NjBgu7Z7I04tIwMp6La5vM-mVxezbU' => $embedded_response_exception->placeholderRenderArray, ], ], ]; $embedded_response_exception->embeddedAjaxResponseCommands = NULL; - $embedded_response_exception->bigPipeNoJsPlaceholder = '
'; + $embedded_response_exception->bigPipeNoJsPlaceholder = '
'; $embedded_response_exception->bigPipeNoJsPlaceholderRenderArray = [ '#markup' => $embedded_response_exception->bigPipeNoJsPlaceholder, '#cache' => $cacheability_depends_on_session_and_nojs_cookie, diff --git a/core/modules/big_pipe/src/Tests/BigPipeTest.php b/core/modules/big_pipe/src/Tests/BigPipeTest.php index a3f773ee16b5f350815cbaa8dc93497370751ed5..bb032e5d33b8222f8525c47d7668a0b552c25dd5 100644 --- a/core/modules/big_pipe/src/Tests/BigPipeTest.php +++ b/core/modules/big_pipe/src/Tests/BigPipeTest.php @@ -289,7 +289,7 @@ public function testBigPipeMultiOccurrencePlaceholders() { // @see performMetaRefresh() $this->drupalGet(Url::fromRoute('big_pipe_test_multi_occurrence')); - $big_pipe_placeholder_id = 'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&args[0]&token=a8c34b5e'; + $big_pipe_placeholder_id = 'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&args[0]&token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA'; $expected_placeholder_replacement = '