You are here

function file_update_8300 in Drupal 8

Prevent unused files from being deleted.

File

core/modules/file/file.install, line 121
Install, update and uninstall functions for File module.

Code

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.');
}