diff -u b/modules/simpletest/simpletest.install b/modules/simpletest/simpletest.install --- b/modules/simpletest/simpletest.install +++ b/modules/simpletest/simpletest.install @@ -168,6 +168,7 @@ */ function simpletest_uninstall() { drupal_load('module', 'simpletest'); + simpletest_clean_environment(); // Remove settings variables. variable_del('simpletest_httpauth_method'); @@ -176,7 +177,6 @@ variable_del('simpletest_clear_results'); variable_del('simpletest_verbose'); - simpletest_clean_database(); // Remove generated files. file_unmanaged_delete_recursive('public://simpletest'); } only in patch2: unchanged: --- a/modules/simpletest/simpletest.module +++ b/modules/simpletest/simpletest.module @@ -452,13 +452,15 @@ function simpletest_clean_database() { * Find all leftover temporary directories and remove them. */ function simpletest_clean_temporary_directories() { - $files = scandir('public://simpletest'); $count = 0; - foreach ($files as $file) { - $path = 'public://simpletest/' . $file; - if (is_dir($path) && is_numeric($file)) { - file_unmanaged_delete_recursive($path); - $count++; + if (is_dir('public://simpletest')) { + $files = scandir('public://simpletest'); + foreach ($files as $file) { + $path = 'public://simpletest/' . $file; + if (is_dir($path) && is_numeric($file)) { + file_unmanaged_delete_recursive($path); + $count++; + } } } only in patch2: unchanged: --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -3267,6 +3267,13 @@ function hook_update_last_removed() { * module's database tables are removed, allowing your module to query its own * tables during this routine. * + * When this hook is fired, your module will already be disabled, so its + * .module file will not be automatically included. If you need to call + * API functions from your .module file in this hook, use drupal_load() to make + * them available. (Keep this usage to a minimum, though, since some functions + * may not behave as expected due to the module being already disabled; e.g., + * your module's hook implementations will not be automatically invoked.) + * * @see hook_install() * @see hook_schema() * @see hook_disable()