core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php | 8 ++++++-- core/lib/Drupal/Core/Render/RenderCache.php | 4 ++-- core/modules/smart_cache/smart_cache.module | 2 -- .../smart_cache/src/EventSubscriber/SmartCacheSubscriber.php | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php b/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php index 660b0b6..301f8c2 100644 --- a/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php +++ b/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php @@ -134,10 +134,10 @@ public function processAttachments(AttachmentsInterface $response) { } /** - * Renders placeholders (#attached[placeholders]). + * Renders placeholders (#attached['placeholders']). * * @param \Drupal\Core\Render\HtmlResponse $response - * The HTML response whose placeholders to replace. + * The HTML response whose placeholders are being replaced. * * @see \Drupal\Core\Render\Renderer::replacePlaceholders() * @see \Drupal\Core\Render\Renderer::renderPlaceholder() @@ -148,6 +148,10 @@ protected function renderPlaceholders(HtmlResponse $response) { '#markup' => SafeString::create($response->getContent()), '#attached' => $response->getAttachments(), ]; + // RendererInterface::renderRoot() renders the $build render array, it + // updates $build by reference. We don't care about the return value (which + // is just $build['#markup']), but about the resulting render array. + // @todo Simplify this when https://www.drupal.org/node/2495001 lands. $this->renderer->renderRoot($build); // Update the Response object now that the placeholders have been rendered. diff --git a/core/lib/Drupal/Core/Render/RenderCache.php b/core/lib/Drupal/Core/Render/RenderCache.php index 6143c3c..37be19d 100644 --- a/core/lib/Drupal/Core/Render/RenderCache.php +++ b/core/lib/Drupal/Core/Render/RenderCache.php @@ -17,8 +17,8 @@ /** * Wraps the caching logic for the render caching system. * - * @todo Refactor this out into a separate service that is capable of cache - * redirects in a non-render array-specific way. + * @todo Refactor this out into a generic service capable of cache redirects, + * let RenderCache use that. https://www.drupal.org/node/2551419 */ class RenderCache implements RenderCacheInterface { diff --git a/core/modules/smart_cache/smart_cache.module b/core/modules/smart_cache/smart_cache.module index cbd0f44..4c0a9e6 100644 --- a/core/modules/smart_cache/smart_cache.module +++ b/core/modules/smart_cache/smart_cache.module @@ -5,8 +5,6 @@ * Caches HTML responses, request and response policies allowing. */ -use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\PageCache\RequestPolicyInterface; use Drupal\Core\Routing\RouteMatchInterface; /** diff --git a/core/modules/smart_cache/src/EventSubscriber/SmartCacheSubscriber.php b/core/modules/smart_cache/src/EventSubscriber/SmartCacheSubscriber.php index 4edc76f..2308f96 100644 --- a/core/modules/smart_cache/src/EventSubscriber/SmartCacheSubscriber.php +++ b/core/modules/smart_cache/src/EventSubscriber/SmartCacheSubscriber.php @@ -19,7 +19,7 @@ use Symfony\Component\HttpKernel\KernelEvents; /** - * Returns cached responses, as early and avoiding as much work as possible. + * Returns cached responses as early and avoiding as much work as possible. * * SmartCache is able to cache so much because it exploits cache contexts: the * cache contexts that are present capture the variations of every component of