'#submit' =>
['::addButtonSubmit'
],
// @todo Move validation in https://www.drupal.org/node/2988215
'#ajax' =>
[ 'callback' => '::updateFormCallback',
'wrapper' => 'media-library-wrapper',
// Add a fixed URL to post the form since AJAX forms are automatically
// posted to <current> instead of $form['#action'].
// @todo Remove when https://www.drupal.org/project/drupal/issues/2504115
// is fixed.
'url' => Url::
fromRoute('media_library.ui'
),
'options' =>
[ 'query' =>
$this->
getMediaLibraryState($form_state)->
all() +
[ FormBuilderInterface::AJAX_FORM_REQUEST => TRUE,
],
],
],
];
return $form;
} /**
* Validates the oEmbed URL.
*
* @param array $form
* The complete form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current form state.
*/