Commit 91f0f7b1 authored by xjm's avatar xjm

Issue #2857410 by tim.plunkett, DamienMcKenna: Adding a page-level #prefix or...

Issue #2857410 by tim.plunkett, DamienMcKenna: Adding a page-level #prefix or #suffix causes it to be output twice on one-col layout
parent f621a88d
......@@ -18,7 +18,7 @@ set classes = [
{% if content %}
<div{{ attributes.addClass(classes) }}>
<div class="layout-region layout-region--content">
{{ content }}
{{ content.content }}
</div>
</div>
{% endif %}
......@@ -41,6 +41,9 @@ protected function setUp() {
public function testRenderLayout($layout_id, $config, $regions, $html) {
$layout = $this->layoutPluginManager->createInstance($layout_id, $config);
$built['layout'] = $layout->build($regions);
$built['layout']['#prefix'] = 'Test prefix';
$built['layout']['#suffix'] = 'Test suffix';
$html = 'Test prefix' . $html . "\n" . 'Test suffix';
// Assume each layout is contained by a form, in order to ensure the
// building of the layout does not interfere with form processing.
......@@ -58,6 +61,15 @@ public function testRenderLayout($layout_id, $config, $regions, $html) {
* Data provider for testRenderLayout().
*/
public function renderLayoutData() {
$data['layout_onecol'] = [
'layout_onecol',
[],
[
'content' => [
'#markup' => 'This is the content',
],
],
];
$data['layout_test_1col_with_form'] = [
'layout_test_1col',
[],
......@@ -122,6 +134,14 @@ public function renderLayoutData() {
],
];
$data['layout_onecol'][] = <<<'EOD'
<div data-drupal-selector="edit-layout" class="layout--onecol">
<div class="layout-region layout-region--content">
This is the content
</div>
</div>
EOD;
$data['layout_test_1col_with_form'][] = <<<'EOD'
<div class="layout-example-1col clearfix">
<div class="region-top">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment