diff -u b/core/includes/language.inc b/core/includes/language.inc --- b/core/includes/language.inc +++ b/core/includes/language.inc @@ -204,7 +204,8 @@ function language_types_set(array $configurable_language_types) { // Ensure that we are getting the defined language negotiation information. An // invocation of \Drupal\Core\Extension\ModuleHandler::install() or - // module_uninstall() could outdate the cached information. + // \Drupal\Core\Extension\ModuleHandler::uninstall() could invalidate the + // cached information. drupal_static_reset('language_types_info'); drupal_static_reset('language_negotiation_info'); @@ -344,7 +345,8 @@ function language_negotiation_purge() { // Ensure that we are getting the defined language negotiation information. An // invocation of \Drupal\Core\Extension\ModuleHandler::install() or - // module_uninstall() could outdate the cached information. + // \Drupal\Core\Extension\ModuleHandler::uninstall() could invalidate the + // cached information. drupal_static_reset('language_negotiation_info'); drupal_static_reset('language_types_info'); diff -u b/core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php b/core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php --- b/core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php @@ -265,12 +265,12 @@ * * @param array $module_list * An array of module names. - * @param $enable_dependencies + * @param bool $enable_dependencies * (optional) If TRUE, dependencies will automatically be installed in the * correct order. This incurs a significant performance cost, so use FALSE * if you know $module_list is already complete. * - * @return + * @return bool * FALSE if one or more dependencies are missing, TRUE otherwise. * * @see hook_module_preinstall() diff -u b/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php b/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php --- b/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php @@ -102,7 +102,7 @@ $module_config_path = drupal_get_path('module', $module) . '/config'; if (is_dir($module_config_path)) { $module_filestorage = new FileStorage($module_config_path); - $config_storage = \Drupal::getContainer()->get('config.storage'); + $config_storage = \Drupal::service('config.storage'); foreach ($module_filestorage->listAll() as $config_name) { // If this file already exists, something in the upgrade path went // completely wrong and we want to know. diff -u b/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php --- b/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php @@ -61,7 +61,7 @@ } /** - * Tests that comment module works when install after a content module. + * Tests that comment module works when installed after a content module. */ function testCommentInstallAfterContentModule() { // Create a user to do module administration. diff -u b/core/modules/forum/forum.install b/core/modules/forum/forum.install --- b/core/modules/forum/forum.install +++ b/core/modules/forum/forum.install @@ -107,11 +107,11 @@ } /** - * Implements hook_modules_preinstall(). + * Implements hook_module_preinstall(). */ -function forum_modules_preinstall($modules) { +function forum_module_preinstall($module) { $list_boolean = Drupal::service('plugin.manager.entity.field.field_type')->getDefinition('list_boolean'); - if (empty($list_boolean) && in_array('forum', $modules)) { + if (empty($list_boolean) && $module == 'forum') { // Make sure that the list_boolean field type is available before our // default config is installed. field_info_cache_clear(); reverted: --- b/core/modules/locale/config/locale.settings.yml +++ a/core/modules/locale/config/locale.settings.yml @@ -3,7 +3,7 @@ directory: 'languages' translation: use_source: 'remote_and_local' + check_disabled_modules: '0' - check_disabled_projects: '0' default_filename: '%project-%version.%language.po' default_server_pattern: 'http://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po' overwrite_customized: '0' reverted: --- b/core/modules/locale/config/schema/locale.schema.yml +++ a/core/modules/locale/config/schema/locale.schema.yml @@ -21,7 +21,7 @@ use_source: type: string label: 'Translation source' + check_disabled_modules: - check_disabled_projects: type: boolean label: 'Check for updates of disabled modules and themes' default_filename: reverted: --- b/core/modules/locale/lib/Drupal/locale/Form/LocaleSettingsForm.php +++ a/core/modules/locale/lib/Drupal/locale/Form/LocaleSettingsForm.php @@ -38,10 +38,10 @@ '#description' => t('Select how frequently you want to check for new interface translations for your currently installed modules and themes. Check updates now.', array('@url' => url('admin/reports/translations/check'))), ); + $form['check_disabled_modules'] = array( - $form['check_disabled_projects'] = array( '#type' => 'checkbox', + '#title' => t('Check for updates of disabled modules and themes'), + '#default_value' => $config->get('translation.check_disabled_modules'), - '#title' => t('Check for updates of disabled projects'), - '#default_value' => $config->get('translation.check_disabled_projects'), ); if ($directory =\Drupal::config('locale.settings')->get('translation.path')) { @@ -126,13 +126,13 @@ } $config + ->set('translation.check_disabled_modules', $values['check_disabled_modules']) - ->set('translation.check_disabled_projects', $values['check_disabled_projects']) ->save(); // Invalidate the cached translation status when the configuration setting of + // 'use_source' and 'check_disabled_modules' change. - // 'use_source' and 'check_disabled_projects' change. if ($form['use_source']['#default_value'] != $form_state['values']['use_source'] || + $form['check_disabled_modules']['#default_value'] != $form_state['values']['check_disabled_modules']) { - $form['check_disabled_projects']['#default_value'] != $form_state['values']['check_disabled_projects']) { locale_translation_clear_status(); } diff -u b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php --- b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php @@ -65,20 +65,21 @@ */ function testUpdateProjectsHidden() { module_load_include('compare.inc', 'locale'); + $config = \Drupal::config('locale.settings'); // Make the test modules look like a normal custom module. \Drupal::state()->set('locale.test_system_info_alter', TRUE); $this->resetAll(); - // Set test condition: include disabled themes when building a project list. + // Set test condition: include disabled modules when building a project list. $edit = array( - 'check_disabled_projects' => TRUE, + 'check_disabled_modules' => TRUE, ); $this->drupalPost('admin/config/regional/translate/settings', $edit, t('Save configuration')); $projects = locale_translation_project_list(); - $this->assertTrue(isset($projects['locale_test_translate']), 'Disabled projects found'); - $this->assertTrue(isset($projects['locale_test']), 'Enabled projects found'); + $this->assertTrue(isset($projects['locale_test_translate']), 'Disabled module found'); + $this->assertTrue(isset($projects['locale_test']), 'Enabled module found'); } /** reverted: --- b/core/modules/locale/locale.compare.inc +++ a/core/modules/locale/locale.compare.inc @@ -142,7 +142,7 @@ $project_info = new ProjectInfo(); $project_info->processInfoList($projects, $module_data, 'module', TRUE, $additional_whitelist); $project_info->processInfoList($projects, $theme_data, 'theme', TRUE, $additional_whitelist); + if ($config->get('translation.check_disabled_modules')) { - if ($config->get('translation.check_disabled_projects')) { $project_info->processInfoList($projects, $module_data, 'module', FALSE, $additional_whitelist); $project_info->processInfoList($projects, $theme_data, 'theme', FALSE, $additional_whitelist); } reverted: --- b/core/modules/locale/locale.translation.inc +++ a/core/modules/locale/locale.translation.inc @@ -330,7 +330,7 @@ $query->join('locale_project', 'p', 'p.name = f.project'); $query->condition('f.last_checked', $last, '<'); $query->fields('f', array('project', 'langcode')); + if (!$config->get('translation.check_disabled_modules')) { - if (!$config->get('translation.check_disabled_projects')) { $query->condition('p.status', 1); } $files = $query->execute()->fetchAll(); diff -u b/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php --- b/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php @@ -42,7 +42,7 @@ * that modules are fully functional while Drupal is installing and enabling * them. */ - function testDrupalWriteRecord() { + public function testDrupalWriteRecord() { // Check for data that was inserted using drupal_write_record() while the // 'module_test' module was being installed and enabled. $data = db_query("SELECT data FROM {module_test}")->fetchCol(); @@ -56,7 +56,7 @@ * dependency resolution. A bug caused the stored weight for User module to * be an array. */ - function testEnableUserTwice() { + public function testEnableUserTwice() { \Drupal::moduleHandler()->install(array('user'), FALSE); $this->assertIdentical(config('system.module')->get('enabled.user'), '0'); } @@ -64,7 +64,7 @@ /** * Tests recorded schema versions of early installed modules in the installer. */ - function testRequiredModuleSchemaVersions() { + public function testRequiredModuleSchemaVersions() { $version = drupal_get_installed_schema_version('system', TRUE); $this->assertTrue($version > 0, 'System module version is > 0.'); $version = drupal_get_installed_schema_version('user', TRUE); @@ -74,7 +74,7 @@ /** * Tests that an exception is thrown when a module name is too long. */ - function testModuleNameLength() { + public function testModuleNameLength() { $module_name = 'invalid_module_name_over_the_maximum_allowed_character_length'; $message = format_string('Exception thrown when enabling module %name with a name length over the allowed maximum', array('%name' => $module_name)); try { diff -u b/core/modules/system/system.api.php b/core/modules/system/system.api.php --- b/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -1945,7 +1945,7 @@ * a chance to perform actions when a module is installed, whereas * hook_install() is only called on the module actually being installed. See * \Drupal\Core\Extension\ModuleHandler::install() for a detailed description of - * the order in which install and enable hooks are invoked. + * the order in which install hooks are invoked. * * @param $modules * An array of the modules that were installed. @@ -1962,7 +1962,7 @@ /** * Perform necessary actions before a module is uninstalled. * - * @param string $modules + * @param string $module * The name of the module about to be uninstalled. */ function hook_module_preuninstall($module) { diff -u b/core/modules/system/system.module b/core/modules/system/system.module --- b/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -2570,11 +2570,11 @@ $files = array(); ksort($modules); // Add name, status, weight, and schema version. - $all_modules = (array) Drupal::config('system.module')->get('enabled'); + $installed_modules = (array) Drupal::config('system.module')->get('enabled'); foreach ($modules as $module => $record) { $record->name = $module; - $record->weight = isset($all_modules[$module]) ? $all_modules[$module] : 0; - $record->status = (int) isset($all_modules[$module]); + $record->weight = isset($installed_modules[$module]) ? $installed_modules[$module] : 0; + $record->status = (int) isset($installed_modules[$module]); $record->schema_version = SCHEMA_UNINSTALLED; $files[$module] = $record->filename; }