diff --git a/core/modules/file/file.install b/core/modules/file/file.install index 0fe7014..9134a25 100644 --- a/core/modules/file/file.install +++ b/core/modules/file/file.install @@ -5,8 +5,6 @@ * Install, update and uninstall functions for File module. */ -use Drupal\Core\Url; - /** * Implements hook_schema(). */ @@ -118,15 +116,3 @@ function file_requirements($phase) { return $requirements; } - -/** - * Prevent unused files from being deleted. - */ -function file_update_8300() { - // Disable deletion of unused permanent files. - \Drupal::configFactory()->getEditable('file.settings') - ->set('make_unused_managed_files_temporary', FALSE) - ->save(); - - return t('Files that have no remaining usages are no longer deleted by default.'); -} diff --git a/core/modules/file/file.post_update.php b/core/modules/file/file.post_update.php new file mode 100644 index 0000000..f1385ff --- /dev/null +++ b/core/modules/file/file.post_update.php @@ -0,0 +1,15 @@ +databaseDumpFiles = [ - __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - ]; - } - - /** - * Tests that block context mapping is updated properly. - */ - public function testUpdateHookN() { - $this->assertIdentical($this->config('file.settings')->get('make_unused_managed_files_temporary'), NULL); - $this->runUpdates(); - $this->assertIdentical($this->config('file.settings')->get('make_unused_managed_files_temporary'), FALSE); - $this->assertResponse('200'); - } - -} diff --git a/core/modules/file/tests/src/Kernel/UsageTest.php b/core/modules/file/tests/src/Kernel/UsageTest.php index 88812a1..f95e9cd 100644 --- a/core/modules/file/tests/src/Kernel/UsageTest.php +++ b/core/modules/file/tests/src/Kernel/UsageTest.php @@ -77,7 +77,7 @@ public function testAddUsage() { /** * Tests file usage deletion when files are made temporary. */ - function testRemoveUsageTemporary() { + public function testRemoveUsageTemporary() { $this->config('file.settings') ->set('make_unused_managed_files_temporary', TRUE) ->save(); @@ -88,7 +88,7 @@ function testRemoveUsageTemporary() { /** * Tests file usage deletion when files are made temporary. */ - function testRemoveUsageNonTemporary() { + public function testRemoveUsageNonTemporary() { $this->config('file.settings') ->set('make_unused_managed_files_temporary', FALSE) ->save();