core/lib/Drupal/Core/Render/Renderer.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/core/lib/Drupal/Core/Render/Renderer.php b/core/lib/Drupal/Core/Render/Renderer.php index a0ef4ef..7cb4d06 100644 --- a/core/lib/Drupal/Core/Render/Renderer.php +++ b/core/lib/Drupal/Core/Render/Renderer.php @@ -170,7 +170,7 @@ protected function renderPlaceholder($placeholder, array $elements) { // Get the render array for the given placeholder $placeholder_elements = $elements['#attached']['placeholders'][$placeholder]; - // Prevent it from being auto-placeholdered again. + // Prevent the render array from being auto-placeholdered again. $placeholder_elements['#create_placeholder'] = FALSE; // Render the placeholder into markup. @@ -655,12 +655,17 @@ protected function replacePlaceholders(array &$elements) { * Whether the given render array has poor cacheability or not. */ protected function hasPoorCacheability(array $element) { - return - // Auto-placeholder if max-age === 0. - (isset($element['#cache']['max-age']) && $element['#cache']['max-age'] === 0) - || - // Auto-placeholder if a high-cardinality cache context is set. - (isset($element['#cache']['contexts']) && array_intersect($element['#cache']['contexts'], $this->rendererConfig['high_cardinality_cache_contexts'])); + // Auto-placeholder if max-age === 0. + if (isset($element['#cache']['max-age']) && $element['#cache']['max-age'] === 0) { + return TRUE; + } + + // Auto-placeholder if a high-cardinality cache context is set. + if (isset($element['#cache']['contexts']) && array_intersect($element['#cache']['contexts'], $this->rendererConfig['high_cardinality_cache_contexts'])) { + return TRUE; + } + + return FALSE; } /**