Skip to content
Snippets Groups Projects
Commit 91f0f7b1 authored by Jess's avatar Jess
Browse files

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
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment