diff --git a/core/config/schema/core.extension.schema.yml b/core/config/schema/core.extension.schema.yml index 9565d8a..7bf3749 100644 --- a/core/config/schema/core.extension.schema.yml +++ b/core/config/schema/core.extension.schema.yml @@ -24,9 +24,6 @@ core.extension: current: type: string label: 'Currently installed version' - install: - type: string - label: 'Version at install time' schema: type: string label: 'Currently installed schema version' diff --git a/core/lib/Drupal/Core/EventSubscriber/ConfigImportSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ConfigImportSubscriber.php index e795080..18ead25 100644 --- a/core/lib/Drupal/Core/EventSubscriber/ConfigImportSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/ConfigImportSubscriber.php @@ -153,10 +153,10 @@ protected function validateModules(ConfigImporter $config_importer) { ); $config_importer->logError($message); } - if ($core_extension['versions'][$module]['install'] !== $module_data[$module]->info['version']) { + if ($core_extension['versions'][$module]['current'] !== $module_data[$module]->info['version']) { $config_importer->logError($this->t( 'Unable to install the %module module since the installed version (@config_version) does not match the code base (@code_version).', - ['%module' => $module, '@config_version' => $core_extension['versions'][$module]['install'], '@code_version' => $module_data[$module]->info['version']] + ['%module' => $module, '@config_version' => $core_extension['versions'][$module]['current'], '@code_version' => $module_data[$module]->info['version']] )); } } @@ -225,10 +225,10 @@ protected function validateThemes(ConfigImporter $config_importer) { $config_importer->logError($this->t('Unable to install the %theme theme since it requires the %required_theme theme.', array('%theme' => $theme_name, '%required_theme' => $required_theme_name))); } } - if ($core_extension['versions'][$theme]['install'] !== $theme_data[$theme]->info['version']) { + if ($core_extension['versions'][$theme]['current'] !== $theme_data[$theme]->info['version']) { $config_importer->logError($this->t( 'Unable to install the %theme theme since the installed version (@config_version) does not match the code base (@code_version).', - ['%theme' => $theme, '@config_version' => $core_extension['versions'][$theme]['install'], '@code_version' => $theme_data[$theme]->info['version']] + ['%theme' => $theme, '@config_version' => $core_extension['versions'][$theme]['current'], '@code_version' => $theme_data[$theme]->info['version']] )); } } diff --git a/core/lib/Drupal/Core/Extension/ModuleInstaller.php b/core/lib/Drupal/Core/Extension/ModuleInstaller.php index afd9bd2..5ab9c85 100644 --- a/core/lib/Drupal/Core/Extension/ModuleInstaller.php +++ b/core/lib/Drupal/Core/Extension/ModuleInstaller.php @@ -303,7 +303,6 @@ public function install(array $module_list, $enable_dependencies = TRUE) { $info = \Drupal::service('info_parser')->parse($list[$module_name]->getPathname()); $versions[$module_name] = [ 'current' => $info['version'], - 'install' => $info['version'], 'schema' => (string) drupal_get_installed_schema_version($module_name), ]; } diff --git a/core/lib/Drupal/Core/Extension/ThemeInstaller.php b/core/lib/Drupal/Core/Extension/ThemeInstaller.php index 006eb94..5bae419 100644 --- a/core/lib/Drupal/Core/Extension/ThemeInstaller.php +++ b/core/lib/Drupal/Core/Extension/ThemeInstaller.php @@ -173,7 +173,6 @@ public function install(array $theme_list, $install_dependencies = TRUE) { $versions = $extension_config->get('versions'); $versions[$key] = [ 'current' => $theme_data[$key]->info['version'], - 'install' => $theme_data[$key]->info['version'], ]; ksort($versions); $extension_config diff --git a/core/modules/config/src/Tests/ConfigImportInstallProfileTest.php b/core/modules/config/src/Tests/ConfigImportInstallProfileTest.php index 19ee917..4f8553a 100644 --- a/core/modules/config/src/Tests/ConfigImportInstallProfileTest.php +++ b/core/modules/config/src/Tests/ConfigImportInstallProfileTest.php @@ -71,8 +71,8 @@ public function testInstallProfileValidation() { unset($core['versions']['stark']); $core['theme']['stable'] = 0; $core['theme']['classy'] = 0; - $core['versions']['stable'] = ['current' => \Drupal::VERSION, 'install' => \Drupal::VERSION]; - $core['versions']['classy'] = ['current' => \Drupal::VERSION, 'install' => \Drupal::VERSION]; + $core['versions']['stable'] = ['current' => \Drupal::VERSION]; + $core['versions']['classy'] = ['current' => \Drupal::VERSION]; ksort($core['versions']); $sync->write('core.extension', $core); $sync->deleteAll('syslog.'); diff --git a/core/modules/config/src/Tests/ConfigImportUITest.php b/core/modules/config/src/Tests/ConfigImportUITest.php index 2ad8896..7c64dbf 100644 --- a/core/modules/config/src/Tests/ConfigImportUITest.php +++ b/core/modules/config/src/Tests/ConfigImportUITest.php @@ -84,13 +84,13 @@ function testImport() { $core_extension['module']['action'] = 0; $core_extension['module']['ban'] = 0; $core_extension['module'] = module_config_sort($core_extension['module']); - $core_extension['versions']['action'] = ['current' => \Drupal::VERSION, 'install' => \Drupal::VERSION, 'schema' => '8000']; - $core_extension['versions']['ban'] = ['current' => \Drupal::VERSION, 'install' => \Drupal::VERSION, 'schema' => '8000']; + $core_extension['versions']['action'] = ['current' => \Drupal::VERSION, 'schema' => '8000']; + $core_extension['versions']['ban'] = ['current' => \Drupal::VERSION, 'schema' => '8000']; // Bartik is a subtheme of classy so classy must be enabled. $core_extension['theme']['classy'] = 0; $core_extension['theme']['bartik'] = 0; - $core_extension['versions']['classy'] = ['current' => \Drupal::VERSION, 'install' => \Drupal::VERSION]; - $core_extension['versions']['bartik'] = ['current' => \Drupal::VERSION, 'install' => \Drupal::VERSION]; + $core_extension['versions']['classy'] = ['current' => \Drupal::VERSION]; + $core_extension['versions']['bartik'] = ['current' => \Drupal::VERSION]; ksort($core_extension['versions']); $sync->write('core.extension', $core_extension); @@ -523,10 +523,10 @@ public function testExtensionValidation() { $core['theme']['does_not_exist'] = 0; // This module does exist but the version is wrong. $core['module']['ban'] = 0; - $core['versions']['ban'] = ['current' => '8.0.0-rc3', 'install' => '8.0.0-rc3', 'schema' => '8000']; + $core['versions']['ban'] = ['current' => '8.0.0-rc3', 'schema' => '8000']; // This theme does exist but the version is wrong. $core['theme']['seven'] = 0; - $core['versions']['seven'] = ['current' => '8.0.0-rc3', 'install' => '8.0.0-rc3']; + $core['versions']['seven'] = ['current' => '8.0.0-rc3']; $core['versions']['bartik']['current'] = '8.0.0-rc3'; $core['versions']['text']['current'] = '8.0.0-rc3'; $core['versions']['config_test']['schema'] = '8999'; diff --git a/core/modules/config/src/Tests/ConfigImporterTest.php b/core/modules/config/src/Tests/ConfigImporterTest.php index 4dc2367..57af7d7 100644 --- a/core/modules/config/src/Tests/ConfigImporterTest.php +++ b/core/modules/config/src/Tests/ConfigImporterTest.php @@ -578,8 +578,8 @@ public function testUnmetDependency() { // Add a module and a theme that depend on uninstalled extensions. $extensions['module']['book'] = 0; $extensions['theme']['bartik'] = 0; - $extensions['versions']['book'] = ['current' => \Drupal::VERSION, 'install' => \Drupal::VERSION]; - $extensions['versions']['bartik'] = ['current' => \Drupal::VERSION, 'install' => \Drupal::VERSION]; + $extensions['versions']['book'] = ['current' => \Drupal::VERSION]; + $extensions['versions']['bartik'] = ['current' => \Drupal::VERSION]; $sync->write('core.extension', $extensions); try { diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php index aecf0f9..848d5df 100644 --- a/core/modules/simpletest/src/KernelTestBase.php +++ b/core/modules/simpletest/src/KernelTestBase.php @@ -526,7 +526,6 @@ protected function enableModules(array $modules) { $version = \Drupal::service('info_parser')->parse($module_list[$module]->getPathname())['version']; $extensions['versions'][$module] = [ 'current' => $version, - 'install' => $version, 'schema' => (string) SCHEMA_UNINSTALLED, ]; } diff --git a/core/modules/simpletest/src/Tests/KernelTestBaseTest.php b/core/modules/simpletest/src/Tests/KernelTestBaseTest.php index 33fbeaa..240683d 100644 --- a/core/modules/simpletest/src/Tests/KernelTestBaseTest.php +++ b/core/modules/simpletest/src/Tests/KernelTestBaseTest.php @@ -342,7 +342,7 @@ public function testEnableModules() { $this->enableModules(['system', 'user']); $core = \Drupal::config('core.extension'); $this->assertEqual(['entity_test' => 0, 'user' => 0, 'system' => 0], $core->get('module')); - $this->assertEqual(['current' => \Drupal::VERSION, 'install' => \Drupal::VERSION, 'schema' => (string) SCHEMA_UNINSTALLED], $core->get('versions.user')); + $this->assertEqual(['current' => \Drupal::VERSION, 'schema' => (string) SCHEMA_UNINSTALLED], $core->get('versions.user')); $this->assertTrue(\Drupal::moduleHandler()->moduleExists('system')); } diff --git a/core/modules/system/src/Tests/Update/VersionInfoUpdateTest.php b/core/modules/system/src/Tests/Update/VersionInfoUpdateTest.php index 280cbe8..17132e4 100644 --- a/core/modules/system/src/Tests/Update/VersionInfoUpdateTest.php +++ b/core/modules/system/src/Tests/Update/VersionInfoUpdateTest.php @@ -31,31 +31,27 @@ protected function setDatabaseDumpFiles() { public function testSystemUpdate8015() { // Set a partial value to ensure that regardless everything is updated // correctly. - $this->config('core.extension')->set('versions.user.install', '8.0.0')->save(); + $this->config('core.extension')->set('versions.user.current', '8.0.0')->save(); $this->runUpdates(); // Test that a module is added. $this->assertEqual([ 'current' => \Drupal::VERSION, - 'install' => \Drupal::VERSION, 'schema' => drupal_get_installed_schema_version('system'), ], $this->config('core.extension')->get('versions.system')); // Test that a profile is added. $this->assertEqual([ 'current' => \Drupal::VERSION, - 'install' => \Drupal::VERSION, 'schema' => drupal_get_installed_schema_version('standard'), ], $this->config('core.extension')->get('versions.standard')); // Test that a theme is added. $this->assertEqual([ 'current' => \Drupal::VERSION, - 'install' => \Drupal::VERSION, ], $this->config('core.extension')->get('versions.bartik')); // Test that any existing version information is merged correctly. $this->assertEqual([ 'current' => \Drupal::VERSION, - 'install' => '8.0.0', 'schema' => drupal_get_installed_schema_version('user'), ], $this->config('core.extension')->get('versions.user')); diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 89577a2..3bcfa85 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1907,9 +1907,6 @@ function system_update_8015() { $version = $info_parser->parse($extension->getPathname())['version']; $return = [ 'current' => $version, - // We can't know which version was present at install time so all we can - // do is use the current version. - 'install' => $version, ]; // Modules and profiles also stored the schema version. if ($extension->getType() === 'module' || $extension->getType() === 'profile') { diff --git a/core/tests/Drupal/KernelTests/KernelTestBase.php b/core/tests/Drupal/KernelTests/KernelTestBase.php index 7780ead..b9c633f 100644 --- a/core/tests/Drupal/KernelTests/KernelTestBase.php +++ b/core/tests/Drupal/KernelTests/KernelTestBase.php @@ -838,7 +838,6 @@ protected function enableModules(array $modules) { $version = \Drupal::service('info_parser')->parse($module_list[$module]->getPathname())['version']; $extension_config['versions'][$module] = [ 'current' => $version, - 'install' => $version, 'schema' => (string) SCHEMA_UNINSTALLED, ]; } diff --git a/core/tests/Drupal/KernelTests/KernelTestBaseTest.php b/core/tests/Drupal/KernelTests/KernelTestBaseTest.php index 604711d..8585726 100644 --- a/core/tests/Drupal/KernelTests/KernelTestBaseTest.php +++ b/core/tests/Drupal/KernelTests/KernelTestBaseTest.php @@ -218,7 +218,7 @@ public function testEnableModules() { $this->enableModules(['system', 'user']); $core = \Drupal::config('core.extension'); $this->assertEquals(['user' => 0, 'system' => 0], $core->get('module')); - $this->assertEquals(['current' => \Drupal::VERSION, 'install' => \Drupal::VERSION, 'schema' => (string) SCHEMA_UNINSTALLED], $core->get('versions.user')); + $this->assertEquals(['current' => \Drupal::VERSION, 'schema' => (string) SCHEMA_UNINSTALLED], $core->get('versions.user')); $this->assertTrue(\Drupal::moduleHandler()->moduleExists('system')); }