summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/file/file.install
diff options
context:
space:
mode:
authorNathaniel Catchpole <catch@35733.no-reply.drupal.org>2017-07-21 09:32:10 +0100
committerNathaniel Catchpole <catch@35733.no-reply.drupal.org>2017-07-21 09:32:10 +0100
commite3ceb190af269cafca7fe73399f62d995b96a6b9 (patch)
tree26d28b370b0e56548ce3ea690f80e1368c0a6534 /core/modules/file/file.install
parente0ea6c67e5b8438420dc55f11dac01eda0054259 (diff)
downloaddrupal-e3ceb190af269cafca7fe73399f62d995b96a6b9.tar.gz
drupal-e3ceb190af269cafca7fe73399f62d995b96a6b9.zip
Issue #2801777 by Berdir, Wim Leers, Pol, alexpott, dawehner, Jo Fitzgerald, Munavijayalakshmi, poornima.n, ifrik, Bojhan, catch: Prevent drupal from deleting temporary files
Diffstat (limited to 'core/modules/file/file.install')
-rw-r--r--core/modules/file/file.install12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/modules/file/file.install b/core/modules/file/file.install
index 9134a25e9e2..48d2bb2d81f 100644
--- a/core/modules/file/file.install
+++ b/core/modules/file/file.install
@@ -116,3 +116,15 @@ 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.');
+}