diff --git a/core/authorize.php b/core/authorize.php index d814ba3..9cdb570 100644 --- a/core/authorize.php +++ b/core/authorize.php @@ -78,8 +78,8 @@ function authorize_access_allowed() { // We have to enable the user and system modules, even to check access and // display errors via the maintenance theme. -$module_list['system']['filename'] = 'core/modules/system/system.module'; -$module_list['user']['filename'] = 'core/modules/user/user.module'; +$module_list['system'] = 'core/modules/system/system.module'; +$module_list['user'] = 'core/modules/user/user.module'; drupal_container()->get('extension_handler')->setModuleList($module_list); drupal_container()->get('extension_handler')->load('system'); drupal_container()->get('extension_handler')->load('user'); diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index f3f2c40..0cdedb9 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -1146,7 +1146,7 @@ function bootstrap_invoke_all($hook) { * TRUE if the item is loaded or has already been loaded. */ function drupal_load($type, $name) { - if ($type == 'module') { + if ($type == 'module' && drupal_container()->get('extension_handler')->moduleExists($name)) { return drupal_container()->get('extension_handler')->load($name); } diff --git a/core/includes/module.inc b/core/includes/module.inc index 5e2f1b9..3f9de34 100644 --- a/core/includes/module.inc +++ b/core/includes/module.inc @@ -456,6 +456,10 @@ function module_disable($module_list, $disable_dependents = TRUE) { } if (!empty($invoke_modules)) { + // Refresh the system list to exclude the disabled modules. + // @todo This call is only needed so that the theme info gets rebuilt - see + // the todo in system_list_reset(). + system_list_reset(); // Refresh the module list to exclude the disabled modules. drupal_container()->get('extension_handler')->moduleImplementsReset(); entity_info_cache_clear(); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/MainContentFallbackTest.php b/core/modules/system/lib/Drupal/system/Tests/System/MainContentFallbackTest.php index 2de5ad3..d83bdc3 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/MainContentFallbackTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/MainContentFallbackTest.php @@ -55,8 +55,8 @@ function testMainContentFallback() { // Disable the block module. $edit['modules[Core][block][enable]'] = FALSE; $this->drupalPost('admin/modules', $edit, t('Save configuration')); + $this->rebuildContainer(); $this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.'); - system_list_reset(); $this->assertFalse(module_exists('block'), 'Block module disabled.'); // At this point, no region is filled and fallback should be triggered. @@ -89,8 +89,8 @@ function testMainContentFallback() { $edit = array(); $edit['modules[Core][block][enable]'] = 'block'; $this->drupalPost('admin/modules', $edit, t('Save configuration')); + $this->rebuildContainer(); $this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.'); - system_list_reset(); $this->assertTrue(module_exists('block'), 'Block module re-enabled.'); } }