Unverified Commit 8b80368c 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
parent a6596677
...@@ -86,11 +86,10 @@ public function viewsForm(array &$form, FormStateInterface $form_state) { ...@@ -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, // 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 // 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. // 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 = $this->view->getRequest()->query->all();
$query[FormBuilderInterface::AJAX_FORM_REQUEST] = TRUE; $query[FormBuilderInterface::AJAX_FORM_REQUEST] = TRUE;
$form['actions']['submit']['#ajax'] = [ $form['actions']['submit']['#ajax'] = [
'url' => Url::fromUserInput($url), 'url' => Url::fromRoute('media_library.ui'),
'options' => [ 'options' => [
'query' => $query, '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