core/lib/Drupal/Core/StreamWrapper/PrivateStream.php | 2 +- .../modules/file/src/Tests/FileFieldRSSContentTest.php | 2 +- core/modules/locale/src/Tests/LocaleUpdateBase.php | 6 +++--- .../tests/modules/locale_test/locale_test.module | 18 +++++++++--------- core/modules/system/system.routing.yml | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php b/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php index 2171ceb..ce07656 100644 --- a/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php +++ b/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php @@ -34,6 +34,6 @@ public function getDirectoryPath() { */ function getExternalUrl() { $path = str_replace('\\', '/', $this->getTarget()); - return $this->url('system.files_url_generator', ['filepath' => $path], ['absolute' => TRUE]); + return $this->url('system.private_file_download', ['filepath' => $path], ['absolute' => TRUE]); } } diff --git a/core/modules/file/src/Tests/FileFieldRSSContentTest.php b/core/modules/file/src/Tests/FileFieldRSSContentTest.php index 5da2242..b11090f 100644 --- a/core/modules/file/src/Tests/FileFieldRSSContentTest.php +++ b/core/modules/file/src/Tests/FileFieldRSSContentTest.php @@ -68,7 +68,7 @@ function testFileFieldRSSContent() { 'key' => 'enclosure', 'value' => "", 'attributes' => array( - 'url' => url("$this->public_files_directory/$uploaded_filename", array('absolute' => TRUE)), + 'url' => file_create_url("public://$uploaded_filename", array('absolute' => TRUE)), 'length' => $node_file->getSize(), 'type' => $node_file->getMimeType() ), diff --git a/core/modules/locale/src/Tests/LocaleUpdateBase.php b/core/modules/locale/src/Tests/LocaleUpdateBase.php index 772ac2a..59abbfe 100644 --- a/core/modules/locale/src/Tests/LocaleUpdateBase.php +++ b/core/modules/locale/src/Tests/LocaleUpdateBase.php @@ -51,9 +51,9 @@ protected function setUp() { parent::setUp(); // Update module should not go out to d.o to check for updates. We override - // the url to the default update_test xml path. But without providing - // a mock xml file, no update data will be found. - \Drupal::config('update.settings')->set('fetch.url', url('update-test', array('absolute' => TRUE)))->save(); + // the URL to the frontpage, which of course does not provide update data, + // hence no data will be found. + \Drupal::config('update.settings')->set('fetch.url', \Drupal::url('', [], array('absolute' => TRUE)))->save(); // Setup timestamps to identify old and new translation sources. $this->timestampOld = REQUEST_TIME - 300; diff --git a/core/modules/locale/tests/modules/locale_test/locale_test.module b/core/modules/locale/tests/modules/locale_test/locale_test.module index d9fd382..255345f 100644 --- a/core/modules/locale/tests/modules/locale_test/locale_test.module +++ b/core/modules/locale/tests/modules/locale_test/locale_test.module @@ -46,19 +46,15 @@ function locale_test_locale_translation_projects_alter(&$projects) { $projects['drupal']['server_pattern'] = 'translations://'; if (\Drupal::state()->get('locale.test_projects_alter')) { - - // Instead of the default ftp.drupal.org we use the file system of the test - // instance to simulate a remote file location. - $url = url(NULL, array('absolute' => TRUE)); - $remote_url = $url . PublicStream::basePath() . '/remote/'; - // Completely replace the project data with a set of test projects. $projects = array( 'contrib_module_one' => array( 'name' => 'contrib_module_one', 'info' => array( 'name' => 'Contributed module one', - 'interface translation server pattern' => $remote_url . '%core/%project/%project-%version.%language._po', + // Instead of the default ftp.drupal.org we use the file system of the + // test instance to simulate a remote file location. + 'interface translation server pattern' => file_create_url('public://remote/%core/%project/%project-%version.%language._po'), 'package' => 'Other', 'version' => '8.x-1.1', 'project' => 'contrib_module_one', @@ -73,7 +69,9 @@ function locale_test_locale_translation_projects_alter(&$projects) { 'name' => 'contrib_module_two', 'info' => array( 'name' => 'Contributed module two', - 'interface translation server pattern' => $remote_url . '%core/%project/%project-%version.%language._po', + // Instead of the default ftp.drupal.org we use the file system of the + // test instance to simulate a remote file location. + 'interface translation server pattern' => file_create_url('public://remote/%core/%project/%project-%version.%language._po'), 'package' => 'Other', 'version' => '8.x-2.0-beta4', 'project' => 'contrib_module_two', @@ -88,7 +86,9 @@ function locale_test_locale_translation_projects_alter(&$projects) { 'name' => 'contrib_module_three', 'info' => array( 'name' => 'Contributed module three', - 'interface translation server pattern' => $remote_url . '%core/%project/%project-%version.%language._po', + // Instead of the default ftp.drupal.org we use the file system of the + // test instance to simulate a remote file location. + 'interface translation server pattern' => file_create_url('public://remote/%core/%project/%project-%version.%language._po'), 'package' => 'Other', 'version' => '8.x-1.0', 'project' => 'contrib_module_three', diff --git a/core/modules/system/system.routing.yml b/core/modules/system/system.routing.yml index 1cbed74..515dd05 100644 --- a/core/modules/system/system.routing.yml +++ b/core/modules/system/system.routing.yml @@ -304,7 +304,7 @@ system.files: requirements: _access: 'TRUE' -system.files_url_generator: +system.private_file_download: path: '/system/files/{filepath}' defaults: _controller: 'Drupal\system\FileDownloadController::download'