Skip to content
Snippets Groups Projects
Unverified Commit 44b124ac authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3075645 by chr.fritsch, maacl, super_romeo, volkerk, alexpott:...

Issue #3075645 by chr.fritsch, maacl, super_romeo, volkerk, alexpott: temporary://update-cache-60b12ec6 is not a directory. in FileSystem->scanDirectory()
parent bc6aabc9
No related branches found
No related tags found
6 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1012Issue #3226887: Hreflang on non-canonical content pages,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10,!596Issue #3046532: deleting an entity reference field, used in a contextual view, makes the whole site unrecoverable,!496Issue #2463967: Use .user.ini file for PHP settings,!144Issue #2666286: Clean up menu_ui to conform to Drupal coding standards
......@@ -385,6 +385,23 @@ public function testModulePageRunCron() {
$this->assertNoText(t('No update information available.'));
}
/**
* Checks that clearing the disk cache works.
*/
public function testClearDiskCache() {
$directories = [
_update_manager_cache_directory(FALSE),
_update_manager_extract_directory(FALSE),
];
// Check that update directories does not exists.
foreach ($directories as $directory) {
$this->assertDirectoryNotExists($directory);
}
// Method must not fail if update directories do not exists.
update_clear_update_disk_cache();
}
/**
* Checks the messages at admin/modules when the site is up to date.
*/
......
......@@ -806,7 +806,9 @@ function update_clear_update_disk_cache() {
// Search for files and directories in base folder only without recursion.
foreach ($directories as $directory) {
\Drupal::service('file_system')->scanDirectory($directory, '/.*/', ['callback' => 'update_delete_file_if_stale', 'recurse' => FALSE]);
if (is_dir($directory)) {
\Drupal::service('file_system')->scanDirectory($directory, '/.*/', ['callback' => 'update_delete_file_if_stale', 'recurse' => FALSE]);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment