0

After updating to 8.8.1 I get this warning:

You are using deprecated configuration for the temporary files path. Remove the configuration and add the following to settings.php. $settings["file_temp_path"] = ".tmp"

But I can not remove the configuration, because the page: "admin/config/media/file-system" is not editable.

0

Starting in 8.8, Drupal no longer allows setting the temp directory on the file system setting form. The form deliberately disables the field to prevent folks from using it. For full info about this change, see Deprecate file_directory_temp() and move to FileSystem service on d.o.

All you have to do is set the temp directory path in settings.php as the message indicates.

$settings['file_temp_path'] = '/path/to/tmp';

Note: if your temp directory is not /tmp, do this before running database updates. From the d.o issue where this change was implemented:

If your site is not using /tmp, you must update settings.php before running database updates.

What if I run database updates before setting the temp path in settings.php?

Looking at the issue and reviewing the most recent patch (patch #121), it doesn't look like anything terrible happens. The only thing that happens during update.php is it attempts to delete the deprecated config for temp file path from system.file.path.temporary (where it's set on the /admin/config/media/file-system page). However, it'll only remove the config if it's safe to do so.

/**
 * Remove 'path.temporary' config if redundant.
 */
function system_update_8801() {
  // If settings is already being used, or the config is set to the OS default,
  // clear the config value.
  $config = Drupal::configFactory()->getEditable('system.file');
  if (Settings::get('file_temp_path') || $config->get('path.temporary') === FileSystem::getOsTemporaryDirectory()) {
    $config->clear('path.temporary')
      ->save(TRUE);
  }
}

While nothing is broken, you will end up with deprecated config just hanging around (forever?). To get your site to a state that matches where it would've been had you made the settings.php update before running updates, make sure you set $settings['file_temp_path'] in settings.php and then do one of the following:

  1. Create a new update hook in a custom module that has the same contents of system_update_8801() then run updates again after making the update to settings.php.

  2. Manually edit the config file in your config directory to remove the configuration, then import.

  3. See How do I re-run updates (change module schema version)? to attempt to rerun the original update.

| improve this answer | |
  • The problem is that I ran the updates before knowing this issue. – Ximo Nadal Dec 20 '19 at 10:03
  • I updated the answer with more information about what to do if you ran updates before setting in settings.php. If you are seeing issues that stemmed from you running updates before setting in settings.php, you should add new questions to tackle those issues individually. – sonfd Dec 20 '19 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.