You are here

function _media_library_views_form_media_library_after_build in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/media_library/media_library.module \_media_library_views_form_media_library_after_build()

Form #after_build callback for media_library view's exposed filters form.

1 string reference to '_media_library_views_form_media_library_after_build'
media_library_form_alter in core/modules/media_library/media_library.module
Implements hook_form_alter().

File

core/modules/media_library/media_library.module, line 311
Contains hook implementations for the media_library module.

Code

function _media_library_views_form_media_library_after_build(array $form, FormStateInterface $form_state) {

  // Remove .form-actions from the view's exposed filter actions. This prevents
  // the "Apply filters" submit button from being moved into the dialog's
  // button area.
  // @see \Drupal\Core\Render\Element\Actions::processActions
  // @see Drupal.behaviors.dialog.prepareDialogButtons
  // @todo Remove this after
  //   https://www.drupal.org/project/drupal/issues/3089751 is fixed.
  if (($key = array_search('form-actions', $form['actions']['#attributes']['class'])) !== FALSE) {
    unset($form['actions']['#attributes']['class'][$key]);
  }
  return $form;
}