diff --git a/core/modules/outside_in/src/OffCanvasFormDialogTrait.php b/core/modules/outside_in/src/OffCanvasFormDialogTrait.php index 990d897e4f..00954fb308 100644 --- a/core/modules/outside_in/src/OffCanvasFormDialogTrait.php +++ b/core/modules/outside_in/src/OffCanvasFormDialogTrait.php @@ -5,7 +5,6 @@ use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\RedirectCommand; use Drupal\Core\Ajax\ReplaceCommand; -use Drupal\Core\EventSubscriber\MainContentViewSubscriber; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; @@ -22,18 +21,6 @@ trait OffCanvasFormDialogTrait { /** - * Determines if the current request is for an AJAX modal dialog. - * - * @return bool - * TRUE is the current request if for an AJAX modal dialog. - */ - protected function isOffCanvasDialog() { - $wrapper_format = $this->getRequest() - ->get(MainContentViewSubscriber::WRAPPER_FORMAT); - return $wrapper_format === 'drupal_dialog.off_canvas'; - } - - /** * Adds modal dialog support to a form. * * @param array $form @@ -42,13 +29,7 @@ protected function isOffCanvasDialog() { * The current state of the form. */ protected function buildFormDialog(array &$form, FormStateInterface $form_state) { - if (!$this->isOffCanvasDialog()) { - return; - } - $form['actions']['submit']['#ajax'] = [ - 'dialogType' => $this->getDialogType(), - 'dialogRenderer' => $this->getDialogRenderer(), 'callback' => '::submitFormDialog', 'event' => 'click', ]; @@ -58,33 +39,6 @@ protected function buildFormDialog(array &$form, FormStateInterface $form_state) } /** - * @return mixed - */ - protected function getRequestWrapperFormat() { - $wrapper_format = $this->getRequest() - ->get(MainContentViewSubscriber::WRAPPER_FORMAT); - return $wrapper_format; - } - /** - * - */ - protected function getDialogType() { - $wrapper_format = $this->getRequestWrapperFormat(); - $wrapper_format_parts = explode('.', $wrapper_format); - // Remove the "drupal_" prefix. - return substr($wrapper_format_parts[0], 7); - } - - /** - * - */ - protected function getDialogRenderer() { - $wrapper_format = $this->getRequestWrapperFormat(); - $wrapper_format_parts = explode('.', $wrapper_format); - return isset($wrapper_format_parts[1]) ? $wrapper_format_parts[1] : NULL; - } - - /** * Submit form dialog #ajax callback. * * @param array $form