diff -u b/includes/bootstrap.inc b/includes/bootstrap.inc --- b/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -910,6 +910,18 @@ } } + if (isset($missing[$type][$name]) && is_string($missing[$type][$name])) { + // This file has moved and the result of a file scan had been cached. + if (file_exists($missing[$type][$name])) { + $files[$type][$name] = $missing[$type][$name]; + } + else { + // File is not available anymore at its new location. Re-do file scan. + unset($missing[$type][$name]); + $missing['#write_cache'] = TRUE; + } + } + if (!isset($dirs[$dir][$extension]) && !isset($missing[$type][$name])) { $dirs[$dir][$extension] = TRUE; if (!function_exists('drupal_system_listing')) { @@ -928,7 +940,8 @@ if (isset($files_scanned[$type][$name])) { $files[$type][$name] = $files_scanned[$type][$name]; if (isset($database_file_exists) && $database_file_exists === FALSE) { - // This file has moved. Cache its new location into the missing files cache. + // This file has moved. Cache its new location into the missing files + // cache. $missing[$type][$name] = $files_scanned[$type][$name]; $missing['#write_cache'] = TRUE; trigger_error(format_string('The following @type has moved on the file system: @name. Clearing caches may help fix this. For more information, see the documentation page.', array('@type' => $type, '@name' => $name, '@documentation' => 'https://www.drupal.org/node/2487215')), E_USER_WARNING); @@ -2526,7 +2539,8 @@ spl_autoload_register('drupal_autoload_interface'); // Reset the drupal_get_filename() static missing filenames cache as it - // may have previously been initialized without the database being available. + // may have previously been initialized without the database being + // available. drupal_static_reset('drupal_get_filename:missing'); }