core/lib/Drupal/Core/Render/Renderer.php | 11 +++++------
.../Drupal/Tests/Core/Render/RendererPlaceholdersTest.php | 4 ++--
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/core/lib/Drupal/Core/Render/Renderer.php b/core/lib/Drupal/Core/Render/Renderer.php
index 9927268..5bb4916 100644
--- a/core/lib/Drupal/Core/Render/Renderer.php
+++ b/core/lib/Drupal/Core/Render/Renderer.php
@@ -705,15 +705,14 @@ protected function createPlaceholder(array $element) {
// is unique markup that isn't easily guessable. The #lazy_builder callback
// and its arguments are put in the placeholder markup solely to simplify
// debugging.
- $attributes = new Attribute();
- $attributes['data-callback'] = $placeholder_render_array['#lazy_builder'][0];
- $attributes['arguments'] = UrlHelper::buildQuery($placeholder_render_array['#lazy_builder'][1]);
- $attributes['token'] = hash('crc32b', serialize($placeholder_render_array));
- $placeholder_markup = SafeMarkup::format('', ['@attributes' => $attributes]);
+ $callback = $placeholder_render_array['#lazy_builder'][0];
+ $arguments = UrlHelper::buildQuery($placeholder_render_array['#lazy_builder'][1]);
+ $token = hash('crc32b', serialize($placeholder_render_array));
+ $placeholder_markup = '';
// Build the placeholder element to return.
$placeholder_element = [];
- $placeholder_element['#markup'] = $placeholder_markup;
+ $placeholder_element['#markup'] = SafeString::create($placeholder_markup);
$placeholder_element['#attached']['placeholders'][$placeholder_markup] = $placeholder_render_array;
return $placeholder_element;
}
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php b/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
index 3fea140..bf8406d 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php
@@ -72,7 +72,7 @@ public function providerPlaceholders() {
// \Drupal\Core\Render\SafeString::create() is necessary as the render
// system would mangle this markup. As this is exactly what happens at
// runtime this is a valid use-case.
- return SafeString::create('');
+ return SafeString::create('');
};
$extract_placeholder_render_array = function ($placeholder_render_array) {
@@ -441,7 +441,7 @@ public function testCacheableParent($test_element, $args, array $expected_placeh
$this->setUpRequest('GET');
$token = hash('crc32b', serialize($expected_placeholder_render_array));
- $expected_placeholder_markup = '';
+ $expected_placeholder_markup = '';
$this->assertSame($expected_placeholder_markup, Html::normalize($expected_placeholder_markup), 'Placeholder unaltered by Html::normalize() which is used by FilterHtmlCorrector.');
// GET request: #cache enabled, cache miss.