diff --git a/core/includes/update.inc b/core/includes/update.inc index fb81b76..1a90660 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -1188,8 +1188,14 @@ function update_retrieve_dependencies() { $return = array(); // Get a list of installed modules, arranged so that we invoke their hooks in // the same order that module_invoke_all() does. - foreach (config('system.module')->get('enabled') as $module => $weight) { - $function = $module . '_update_dependencies'; + foreach (drupal_container()->get('keyvalue')->get('system.schema')->getAll() as $module => $schema) { + if ($schema == SCHEMA_UNINSTALLED) { + // Nothing to upgrade. + continue; + } + $function = $module . '_update_dependencies'; + // Ensure install file is loaded. + module_load_install($module); if (function_exists($function)) { $result = $function(); // Each implementation of hook_update_dependencies() returns a diff --git a/core/modules/locale/locale.install b/core/modules/locale/locale.install index b439bb6..a607302 100644 --- a/core/modules/locale/locale.install +++ b/core/modules/locale/locale.install @@ -505,8 +505,10 @@ function locale_update_8004() { $negotiation = update_variable_get('language_negotiation_' . $type, NULL); if (!empty($negotiation)) { foreach ($negotiation as $method_id => &$method) { - $method['callbacks']['negotiation'] = $method['callbacks']['language']; - unset($method['callbacks']['language']); + if (isset($method['callbacks']['language'])) { + $method['callbacks']['negotiation'] = $method['callbacks']['language']; + unset($method['callbacks']['language']); + } if (isset($method['callbacks']['switcher'])) { $method['callbacks']['language_switch'] = $method['callbacks']['switcher']; unset($method['callbacks']['switcher']); diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/ModulesDisabledUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/ModulesDisabledUpgradePathTest.php index c4c6f75..c85c912 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/ModulesDisabledUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/ModulesDisabledUpgradePathTest.php @@ -53,5 +53,6 @@ public function testDisabledUpgrade() { require_once DRUPAL_ROOT . '/core/includes/install.inc'; $updates = update_get_update_list(); $this->assertEqual($updates, array(), 'No pending updates after enabling all modules.'); + $this->assertTrue(state()->get('update_test_1_update_dependencies_run'), 'Module update dependencies resolved for disabled modules'); } } diff --git a/core/modules/system/tests/modules/update_test_1/update_test_1.install b/core/modules/system/tests/modules/update_test_1/update_test_1.install index 22398a3..bf0beb3 100644 --- a/core/modules/system/tests/modules/update_test_1/update_test_1.install +++ b/core/modules/system/tests/modules/update_test_1/update_test_1.install @@ -11,6 +11,7 @@ * @see update_test_2_update_dependencies() */ function update_test_1_update_dependencies() { + state()->set('update_test_1_update_dependencies_run', TRUE); // These dependencies are used in combination with those declared in // update_test_2_update_dependencies() for the sole purpose of testing that // the results of hook_update_dependencies() are collected correctly and have diff --git a/core/modules/system/tests/upgrade/drupal-7.all-disabled.database.php b/core/modules/system/tests/upgrade/drupal-7.all-disabled.database.php index 26b819e..b73db60 100644 --- a/core/modules/system/tests/upgrade/drupal-7.all-disabled.database.php +++ b/core/modules/system/tests/upgrade/drupal-7.all-disabled.database.php @@ -18,3 +18,11 @@ ->condition('name', array('filter', 'field', 'field_sql_storage', 'entity', 'system', 'text', 'user'), 'NOT IN') ->execute(); + +db_update('system') + ->fields(array( + 'schema_version' => 0, + )) + ->condition('type', 'module') + ->condition('name', 'update_test_1') + ->execute();