diff --git a/core/modules/outside_in/js/outside_in.js b/core/modules/outside_in/js/outside_in.js index 715106e..7eb241c 100644 --- a/core/modules/outside_in/js/outside_in.js +++ b/core/modules/outside_in/js/outside_in.js @@ -243,7 +243,7 @@ if (instance.hasOwnProperty('dialogType')) { instance.options.url = instance.options.url.replace(searchLink, replaceLink); // Check to make sure existing dialogOptions aren't overridden. - if (!('dialogOptions' in instance.options.data)) { + if (!instance.options.data.hasOwnProperty('dialogOptions')) { instance.options.data.dialogOptions = {}; } instance.options.data.dialogOptions.outsideInActiveEditableId = $(instance.element).parents('.outside-in-editable').attr('id'); diff --git a/core/modules/outside_in/outside_in.libraries.yml b/core/modules/outside_in/outside_in.libraries.yml index 5c9fc8e..faa314a 100644 --- a/core/modules/outside_in/outside_in.libraries.yml +++ b/core/modules/outside_in/outside_in.libraries.yml @@ -21,6 +21,7 @@ drupal.outside_in: - core/jquery.once - core/drupal.ajax - core/drupalSettings + - core/jquery.form drupal.off_canvas: version: VERSION js: diff --git a/core/modules/outside_in/src/Render/MainContent/OffCanvasRender.php b/core/modules/outside_in/src/Render/MainContent/OffCanvasRender.php index 9536215..acc4012 100644 --- a/core/modules/outside_in/src/Render/MainContent/OffCanvasRender.php +++ b/core/modules/outside_in/src/Render/MainContent/OffCanvasRender.php @@ -42,11 +42,13 @@ public function renderResponse(array $main_content, Request $request, RouteMatch $response = new AjaxResponse(); // Add place holder form messages from Ajax form requests. - $main_content['off_canvas_messages'] = [ - '#type' => 'container', - '#attributes' => ['class' => ['messages__wrapper']], - '#weight' => -100, - ]; + $main_content = [ + 'off_canvas_messages' => [ + '#type' => 'container', + '#attributes' => ['class' => ['messages__wrapper']], + '#weight' => 100, + ], + ] + $main_content; // First render the main content, because it might provide a title. $content = $this->renderer->renderRoot($main_content); diff --git a/core/modules/outside_in/tests/src/FunctionalJavascript/OffCanvasTest.php b/core/modules/outside_in/tests/src/FunctionalJavascript/OffCanvasTest.php index 8fe8f74..b2cb676 100644 --- a/core/modules/outside_in/tests/src/FunctionalJavascript/OffCanvasTest.php +++ b/core/modules/outside_in/tests/src/FunctionalJavascript/OffCanvasTest.php @@ -107,13 +107,15 @@ public function testNarrowWidth() { * Test form errors in the Off-Canvas dialog. */ public function testFormErrors() { + $web_assert = $this->assertSession(); $this->drupalGet('/offcanvas-test-links'); $page = $this->getSession()->getPage(); $page->clickLink('Show form!'); $this->waitForOffCanvasToOpen(); + $web_assert->elementExists('css', '.messages__wrapper'); $page->pressButton('Invalid'); - $this->assertSession()->assertWaitOnAjaxRequest(); - $this->assertSession()->elementContains('css', '#drupal-offcanvas', 'Validation error'); + $web_assert->assertWaitOnAjaxRequest(); + $web_assert->elementContains('css', '#drupal-offcanvas', 'Validation error'); } }