summaryrefslogtreecommitdiffstats
path: root/core/lib/Drupal/Core/Render
diff options
context:
space:
mode:
authorLee Rowlands2017-12-22 21:59:09 (GMT)
committerLee Rowlands2017-12-22 21:59:09 (GMT)
commitf9548751b86a7dfb5842a5eb99b37c0b42c1d45d (patch)
treeae6ad5cd6a4c7687cd95f2028ba8004b707f0afe /core/lib/Drupal/Core/Render
parentabebbfb06dae1c7007aae8567356bef82bd227b2 (diff)
Issue #2346893 by lauriii, idebr, slashrsm, RavindraSingh, Rade, Fabianx, alexpott, swentel, gauravjeet, darrenwh, deepak_zyxware, joelpittet, Wim Leers, Yogesh Pawar, Vj, ivan.chavarro, josephdpurcell, josmera01, rloos289, kattekrab, Tanvish Jha, csakiistvan, xjm, larowlan, akalata: Duplicate AJAX wrapper around a file field
Diffstat (limited to 'core/lib/Drupal/Core/Render')
-rw-r--r--core/lib/Drupal/Core/Render/Renderer.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/core/lib/Drupal/Core/Render/Renderer.php b/core/lib/Drupal/Core/Render/Renderer.php
index 5038851..0024694 100644
--- a/core/lib/Drupal/Core/Render/Renderer.php
+++ b/core/lib/Drupal/Core/Render/Renderer.php
@@ -509,11 +509,17 @@ class Renderer implements RendererInterface {
// We store the resulting output in $elements['#markup'], to be consistent
// with how render cached output gets stored. This ensures that placeholder
// replacement logic gets the same data to work with, no matter if #cache is
- // disabled, #cache is enabled, there is a cache hit or miss.
- $prefix = isset($elements['#prefix']) ? $this->xssFilterAdminIfUnsafe($elements['#prefix']) : '';
- $suffix = isset($elements['#suffix']) ? $this->xssFilterAdminIfUnsafe($elements['#suffix']) : '';
-
- $elements['#markup'] = Markup::create($prefix . $elements['#children'] . $suffix);
+ // disabled, #cache is enabled, there is a cache hit or miss. If
+ // #render_children is set the #prefix and #suffix will have already been
+ // added.
+ if (isset($elements['#render_children'])) {
+ $elements['#markup'] = Markup::create($elements['#children']);
+ }
+ else {
+ $prefix = isset($elements['#prefix']) ? $this->xssFilterAdminIfUnsafe($elements['#prefix']) : '';
+ $suffix = isset($elements['#suffix']) ? $this->xssFilterAdminIfUnsafe($elements['#suffix']) : '';
+ $elements['#markup'] = Markup::create($prefix . $elements['#children'] . $suffix);
+ }
// We've rendered this element (and its subtree!), now update the context.
$context->update($elements);