Commit 57546f02 authored by Steven Jones's avatar Steven Jones
Browse files

Issue #3392864 by erom, steven jones: Generate root-relative URLs for downloading files

parent 8b18d5ca
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -906,7 +906,7 @@ class DataExport extends RestExport {
        // Create a web server accessible URL for the private file.
        // Permissions for accessing this URL will be inherited from the View
        // display's configuration.
        $url = \Drupal::service('file_url_generator')->generateAbsoluteString($results['vde_file']);
        $url = \Drupal::service('file_url_generator')->generateString($results['vde_file']);
        $message = t('Export complete. Download the file <a download href=":download_url"  data-download-enabled="false" id="vde-automatic-download">here</a>.', [':download_url' => $url]);
        // If the user specified instant download than redirect to the file.
        if ($results['automatic_download']) {
+0 −1
Original line number Diff line number Diff line
@@ -173,7 +173,6 @@ class DataExport extends Serializer {
    if ($pager = $this->view->getPager()) {
      $url_options['query']['page'] = $pager->getCurrentPage();
    }
    $url_options['absolute'] = TRUE;
    if (!empty($this->options['formats'])) {
      $url_options['query']['_format'] = reset($this->options['formats']);
    }