function file_update_8300

Prevent unused files from being deleted.

File

core/modules/file/file.install, line 121

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.