diff -u b/core/modules/file/config/install/file.settings.yml b/core/modules/file/config/install/file.settings.yml --- b/core/modules/file/config/install/file.settings.yml +++ b/core/modules/file/config/install/file.settings.yml @@ -6 +6 @@ - make_unused_managed_files_temporary: false +make_unused_managed_files_temporary: false diff -u b/core/modules/file/config/schema/file.schema.yml b/core/modules/file/config/schema/file.schema.yml --- b/core/modules/file/config/schema/file.schema.yml +++ b/core/modules/file/config/schema/file.schema.yml @@ -21,9 +21,9 @@ directory: type: path label: 'Directory' - make_unused_managed_files_temporary: - type: boolean - label: 'Controls if unused files should be marked temporary' + make_unused_managed_files_temporary: + type: boolean + label: 'Controls if unused files should be marked temporary' field.storage_settings.file: type: base_entity_reference_field_settings diff -u b/core/modules/file/file.install b/core/modules/file/file.install --- b/core/modules/file/file.install +++ b/core/modules/file/file.install @@ -114,16 +114,16 @@ 'value' => $value, 'description' => $description, ]; - $file_config = \Drupal::configFactory()->get('file.settings'); - $requirements['file_orphaned_file_delete'] = [ - 'title' => t('Orphaned file delete'), - 'value' => t('There are currently known bugs with file usage counting. It is recommended to leave \'Schedule all unused files for deletion\' disabled to prevent the loss of files.', [ - ':url' => Url::fromRoute('system.file_system_settings', [], ['fragment' => 'edit-make-unused-managed-files-temporary']) - ->toString() - ]), - 'severity' => $file_config->get('make_unused_managed_files_temporary') ? REQUIREMENT_WARNING : REQUIREMENT_OK, - ]; } + $file_config = \Drupal::configFactory()->get('file.settings'); + $requirements['file_orphaned_file_delete'] = [ + 'title' => t('Orphaned file delete'), + 'value' => t('There are currently known bugs with file usage counting. It is recommended to leave \'Schedule all unused files for deletion\' disabled to prevent the loss of files.', [ + ':url' => Url::fromRoute('system.file_system_settings', [], ['fragment' => 'edit-make-unused-managed-files-temporary']) + ->toString() + ]), + 'severity' => $file_config->get('make_unused_managed_files_temporary') ? REQUIREMENT_WARNING : REQUIREMENT_OK, + ]; return $requirements; } diff -u b/core/modules/file/src/FileUsage/DatabaseFileUsageBackend.php b/core/modules/file/src/FileUsage/DatabaseFileUsageBackend.php --- b/core/modules/file/src/FileUsage/DatabaseFileUsageBackend.php +++ b/core/modules/file/src/FileUsage/DatabaseFileUsageBackend.php @@ -2,8 +2,8 @@ namespace Drupal\file\FileUsage; -use Drupal\Core\Database\Connection; use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\Database\Connection; use Drupal\file\FileInterface; /** diff -u b/core/modules/file/src/FileUsage/FileUsageBase.php b/core/modules/file/src/FileUsage/FileUsageBase.php --- b/core/modules/file/src/FileUsage/FileUsageBase.php +++ b/core/modules/file/src/FileUsage/FileUsageBase.php @@ -2,8 +2,8 @@ namespace Drupal\file\FileUsage; -use Drupal\file\FileInterface; use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\file\FileInterface; /** * Defines the base class for database file usage backend. diff -u b/core/modules/file/src/Tests/FileListingTest.php b/core/modules/file/src/Tests/FileListingTest.php --- b/core/modules/file/src/Tests/FileListingTest.php +++ b/core/modules/file/src/Tests/FileListingTest.php @@ -30,13 +30,14 @@ protected function setUp() { parent::setUp(); - $this->adminUser = $this->drupalCreateUser(['access files overview', 'bypass node access']); - $this->baseUser = $this->drupalCreateUser(); - $this->createFileField('file', 'node', 'article', [], ['file_extensions' => 'txt png']); // This test expects unused managed files to be marked as a temporary file. $this->config('file.settings') ->set('make_unused_managed_files_temporary', TRUE) ->save(); + + $this->adminUser = $this->drupalCreateUser(['access files overview', 'bypass node access']); + $this->baseUser = $this->drupalCreateUser(); + $this->createFileField('file', 'node', 'article', [], ['file_extensions' => 'txt png']); } /**