Loading core/lib/Drupal/Core/Render/Renderer.php +7 −8 Original line number Diff line number Diff line Loading @@ -250,9 +250,10 @@ protected function doRenderRoot(array &$elements, RenderContext $context): strin return $return; } // Only when we're in a root (non-recursive) Renderer::render() call, // placeholders must be processed, to prevent breaking the render cache in // case of nested elements with #cache set. // Only when rendering the root do placeholders have to be processed. If we // were to replace them while rendering cacheable nested elements, their // cacheable metadata would still bubble all the way up the render tree, // effectively making the use of placeholders pointless. $this->replacePlaceholders($elements); return $elements['#markup']; Loading Loading @@ -304,10 +305,8 @@ protected function doRender(array &$elements, RenderContext $context): string|Ma } $context->push(new BubbleableMetadata()); // Set the bubbleable rendering metadata that has configurable defaults, if: // - this is the root call, to ensure that the final render array definitely // has these configurable defaults, even when no subtree is render cached. // - this is a render cacheable subtree, to ensure that the cached data has // Set the bubbleable rendering metadata that has configurable defaults if // this is a render cacheable subtree, to ensure that the cached data has // the configurable defaults (which may affect the ID and invalidation). if (isset($elements['#cache']['keys'])) { $required_cache_contexts = $this->rendererConfig['required_cache_contexts']; Loading Loading
core/lib/Drupal/Core/Render/Renderer.php +7 −8 Original line number Diff line number Diff line Loading @@ -250,9 +250,10 @@ protected function doRenderRoot(array &$elements, RenderContext $context): strin return $return; } // Only when we're in a root (non-recursive) Renderer::render() call, // placeholders must be processed, to prevent breaking the render cache in // case of nested elements with #cache set. // Only when rendering the root do placeholders have to be processed. If we // were to replace them while rendering cacheable nested elements, their // cacheable metadata would still bubble all the way up the render tree, // effectively making the use of placeholders pointless. $this->replacePlaceholders($elements); return $elements['#markup']; Loading Loading @@ -304,10 +305,8 @@ protected function doRender(array &$elements, RenderContext $context): string|Ma } $context->push(new BubbleableMetadata()); // Set the bubbleable rendering metadata that has configurable defaults, if: // - this is the root call, to ensure that the final render array definitely // has these configurable defaults, even when no subtree is render cached. // - this is a render cacheable subtree, to ensure that the cached data has // Set the bubbleable rendering metadata that has configurable defaults if // this is a render cacheable subtree, to ensure that the cached data has // the configurable defaults (which may affect the ID and invalidation). if (isset($elements['#cache']['keys'])) { $required_cache_contexts = $this->rendererConfig['required_cache_contexts']; Loading