diff -u b/modules/simpletest/tests/bootstrap.test b/modules/simpletest/tests/bootstrap.test --- b/modules/simpletest/tests/bootstrap.test +++ b/modules/simpletest/tests/bootstrap.test @@ -414,18 +414,22 @@ // Generate a non-existing module name. $non_existing_module = uniqid("", TRUE); + // We want to save that our anonymous error handler is triggered. + // This variable is inherited in the error handle with 'use'. + $get_filename_test_triggered_error = FALSE; + // Searching for an item that does not exist returns NULL. // Set a custom error handler so we can ignore the file not found error. - set_error_handler(function($severity, $message, $file, $line) { + set_error_handler(function($severity, $message, $file, $line) use (&$get_filename_test_triggered_error) { // Skip error handling if this is a "file not found" error. if (strstr($message, 'is missing from the file system:')) { - cache_set('get_filename_test_triggered_error', TRUE); + $get_filename_test_triggered_error = TRUE; return; } throw new \ErrorException($message, 0, $severity, $file, $line); }); $this->assertNull(drupal_get_filename('module', $non_existing_module), 'Searching for an item that does not exist returns NULL.'); - $this->assertTrue(cache_get('get_filename_test_triggered_error'), 'Searching for an item that does not exist triggers an error.'); + $this->assertTrue($get_filename_test_triggered_error, 'Searching for an item that does not exist triggers an error.'); // Restore the original error handler. restore_error_handler(); $this->assertNull(drupal_get_filename('module', $non_existing_module), 'Searching for an item that does not exist returns NULL.'); @@ -434,7 +438,7 @@ $bad = &drupal_static('drupal_get_filename:missing'); // Searching for an item that does not exist creates a static record in drupal_get_filename. - $this->assertTrue($missing['module'][$non_existing_module], 'Searching for an item that does not exist creates a static record in drupal_get_filename.'); + $this->assertTrue($bad['module'][$non_existing_module], 'Searching for an item that does not exist creates a static record in drupal_get_filename.'); } } diff -u b/modules/system/system.admin.inc b/modules/system/system.admin.inc --- b/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -136,7 +136,7 @@ function system_themes_page() { // Clean up the bootstrap "missing files" cache when listing themes. drupal_static_reset('drupal_get_filename:missing'); - cache_clear_all('*', 'drupal_get_filename:missing', TRUE); + cache_clear_all('drupal_get_filename:missing', 'cache'); // Get current list of themes. $themes = system_rebuild_theme_data(); @@ -794,7 +794,7 @@ function system_modules($form, $form_state = array()) { // Clean up the bootstrap "missing modules" cache when listing modules. drupal_static_reset('drupal_get_filename:missing'); - cache_clear_all('*', 'drupal_get_filename:missing', TRUE); + cache_clear_all('drupal_get_filename:missing', 'cache'); // Get current list of modules. $files = system_rebuild_module_data();