Commit 25a72bbb authored by alexpott's avatar alexpott

Issue #2990664 by nuez, seanB, cbccharlie, Wim Leers, deepaksingh05, Pancho,...

Issue #2990664 by nuez, seanB, cbccharlie, Wim Leers, deepaksingh05, Pancho, Chi, wwedding, Berdir, phenaproxima: Media library does not work when Drupal is installed into a sub-directory

(cherry picked from commit 8b80368c)
parent 379763d5
......@@ -86,11 +86,10 @@ public function viewsForm(array &$form, FormStateInterface $form_state) {
// Currently the default URL for all AJAX form elements is the current URL,
// not the form action. This causes bugs when this form is rendered from an
// AJAX path like /views/ajax, which cannot process AJAX form submits.
$url = parse_url($form['#action'], PHP_URL_PATH);
$query = $this->view->getRequest()->query->all();
$query[FormBuilderInterface::AJAX_FORM_REQUEST] = TRUE;
$form['actions']['submit']['#ajax'] = [
'url' => Url::fromUserInput($url),
'url' => Url::fromRoute('media_library.ui'),
'options' => [
'query' => $query,
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment