diff --git a/core/modules/outside_in/src/OffCanvasFormDialogTrait.php b/core/modules/outside_in/src/OffCanvasFormDialogTrait.php index af5beece23..391d7801c8 100644 --- a/core/modules/outside_in/src/OffCanvasFormDialogTrait.php +++ b/core/modules/outside_in/src/OffCanvasFormDialogTrait.php @@ -3,9 +3,9 @@ namespace Drupal\outside_in; use Drupal\Core\Ajax\AjaxResponse; -use Drupal\Core\Ajax\HtmlCommand; use Drupal\Core\Ajax\CloseDialogCommand; use Drupal\Core\Ajax\RedirectCommand; +use Drupal\Core\Ajax\ReplaceCommand; use Drupal\Core\EventSubscriber\MainContentViewSubscriber; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; @@ -29,7 +29,7 @@ protected function isModalDialog() { return in_array($wrapper_format, [ 'drupal_ajax', 'drupal_modal', - 'drupal_dialog_off_canvas', + 'drupal_dialog.off_canvas', ]); } @@ -97,7 +97,7 @@ public function submitFormDialog(array &$form, FormStateInterface $form_state) { '#type' => 'status_messages', '#weight' => -1000, ]; - $command = new HtmlCommand('#off-canvas-form', $form); + $command = new ReplaceCommand('#off-canvas-form', $form); } else { if ($redirect_url = $this->getRedirectUrl()) { diff --git a/core/modules/outside_in/src/Render/MainContent/OffCanvasRenderer.php b/core/modules/outside_in/src/Render/MainContent/OffCanvasRenderer.php index ee4bb048ec..3286ed9f4b 100644 --- a/core/modules/outside_in/src/Render/MainContent/OffCanvasRenderer.php +++ b/core/modules/outside_in/src/Render/MainContent/OffCanvasRenderer.php @@ -41,13 +41,6 @@ public function __construct(TitleResolverInterface $title_resolver, RendererInte public function renderResponse(array $main_content, Request $request, RouteMatchInterface $route_match) { $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, - ]; - // First render the main content, because it might provide a title. $content = $this->renderer->renderRoot($main_content); // Attach the library necessary for using the OpenOffCanvasDialogCommand and