Commit 05482f51 authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

fix: #3590897 Sidebar toggle is visible and functioning in media library...

fix: #3590897 Sidebar toggle is visible and functioning in media library dialog, but shouldn't be there

By: jurgenhaas
By: mherchel
By: bernardm28
(cherry picked from commit c6b13555)
(cherry picked from commit 6502b3a8)
parent a81450d5
Loading
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -620,7 +620,7 @@ public function formViewsUiConfigItemFormAlter(array &$form, FormStateInterface
   * @see hook_form_alter()
   */
  public function stickyActionButtonsAndSidebar(array &$form, FormStateInterface $form_state, string $form_id): void {
    if ($this->isModalOrOffcanvas()) {
    if ($this->isAjax()) {
      $form['is_ajax_request'] = ['#weight' => -1];
      return;
    }
@@ -787,17 +787,6 @@ private static function useStickyActionButtons(bool $is_content_form = TRUE): bo
      $flag === 'always';
  }

  /**
   * Check the context we're in.
   *
   * Checks if the form is in either a modal or an off-canvas dialog.
   */
  private function isModalOrOffcanvas(): bool {
    $wrapper_format = $this->getRequestWrapperFormat() ?? '';
    return str_contains($wrapper_format, 'drupal_modal') ||
      str_contains($wrapper_format, 'drupal_dialog');
  }

  /**
   * Helper function to remember the form actions after form has been built.
   */