summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/includes/update.inc8
-rw-r--r--core/lib/Drupal/Core/Update/UpdateKernel.php3
-rw-r--r--core/modules/system/system.install65
-rw-r--r--core/modules/system/tests/src/Functional/Update/WarmCacheUpdateFrom8dot6Test.php36
4 files changed, 4 insertions, 108 deletions
diff --git a/core/includes/update.inc b/core/includes/update.inc
index 6c3fc39..8db6433 100644
--- a/core/includes/update.inc
+++ b/core/includes/update.inc
@@ -16,10 +16,6 @@ use Drupal\Core\Utility\Error;
* Disables any extensions that are incompatible with the current core version.
*/
function update_fix_compatibility() {
- // Fix extension objects if the update is being done via Drush 8. In non-Drush
- // environments this will already be fixed by the UpdateKernel this point.
- UpdateKernel::fixSerializedExtensionObjects(\Drupal::getContainer());
-
$extension_config = \Drupal::configFactory()->getEditable('core.extension');
$save = FALSE;
foreach (['module', 'theme'] as $type) {
@@ -34,6 +30,10 @@ function update_fix_compatibility() {
$extension_config->set('module', module_config_sort($extension_config->get('module')));
$extension_config->save();
}
+
+ // Fix extension objects if the update is being done via Drush 8. In non-Drush
+ // environments this will already be fixed by the UpdateKernel this point.
+ UpdateKernel::fixSerializedExtensionObjects(\Drupal::getContainer());
}
/**
diff --git a/core/lib/Drupal/Core/Update/UpdateKernel.php b/core/lib/Drupal/Core/Update/UpdateKernel.php
index d5051a7..c38dad7 100644
--- a/core/lib/Drupal/Core/Update/UpdateKernel.php
+++ b/core/lib/Drupal/Core/Update/UpdateKernel.php
@@ -219,9 +219,6 @@ class UpdateKernel extends DrupalKernel {
// will be PHP warnings. This silently fixes Drupal so that the update can
// continue.
$callable = function () use ($container) {
- // Reset static caches in profile list so the module list is rebuilt
- // correctly.
- $container->get('extension.list.profile')->reset();
foreach ($container->getParameter('cache_bins') as $service_id => $bin) {
$container->get($service_id)->deleteAll();
}
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index 91d92ec..6eb8c12 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -18,7 +18,6 @@ use Drupal\Core\Entity\ContentEntityTypeInterface;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\FieldableEntityInterface;
use Drupal\Core\DrupalKernel;
-use Drupal\Core\Extension\Extension;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\Site\Settings;
use Drupal\Core\StreamWrapper\PrivateStream;
@@ -2174,67 +2173,3 @@ function system_update_8501() {
}
}
}
-
-/**
-* Fix missing install profile after updating to Drupal 8.6.9 with Drush 8.
-*/
-function system_update_8601() {
- $extension_config = \Drupal::configFactory()->getEditable('core.extension');
- $install_profile = $extension_config->get('profile');
- if (!$install_profile) {
- // There's no install profile configured.
- return;
- }
- $modules = $extension_config->get('module');
- if (isset($modules[$install_profile])) {
- // The install profile is already in the installed module list.
- return;
- }
-
- // Ensure the install profile is available.
- if (!\Drupal::service('extension.list.module')->exists($install_profile)) {
- return t('The %install_profile install profile configured in core.extension is not available.', ['%install_profile' => $install_profile]);
- }
-
- // Add the install profile to the list of enabled modules.
- $modules[$install_profile] = 1000;
- $modules = module_config_sort($modules);
- $extension_config
- ->set('module', $modules)
- ->save(TRUE);
-
- // Build a module list from the updated extension configuration.
- $current_module_filenames = \Drupal::moduleHandler()->getModuleList();
- $current_modules = array_fill_keys(array_keys($current_module_filenames), 0);
- $current_modules = module_config_sort(array_merge($current_modules, $extension_config->get('module')));
- $module_filenames = [];
- foreach ($current_modules as $name => $weight) {
- if (isset($current_module_filenames[$name])) {
- $module_filenames[$name] = $current_module_filenames[$name];
- }
- else {
- $module_path = \Drupal::service('extension.list.module')->getPath($name);
- $pathname = "$module_path/$name.info.yml";
- $filename = file_exists($module_path . "/$name.module") ? "$name.module" : NULL;
- $module_filenames[$name] = new Extension(\Drupal::root(), 'module', $pathname, $filename);
- }
- }
-
- // Update the module handler list to contain the missing install profile.
- \Drupal::moduleHandler()->setModuleList($module_filenames);
- \Drupal::moduleHandler()->load($install_profile);
-
- // Clear the static cache of the "extension.list.module" service to pick
- // up the new install profile correctly.
- \Drupal::service('extension.list.profile')->reset();
-
- // Clear the static cache of the "extension.list.module" service to pick
- // up the new module, since it merges the installation status of modules
- // into its statically cached list.
- \Drupal::service('extension.list.module')->reset();
-
- // Update the kernel to include the missing profile.
- \Drupal::service('kernel')->updateModules($module_filenames, $module_filenames);
-
- return t('The %install_profile install profile has been added to the installed module list.', ['%install_profile' => $install_profile]);
-}
diff --git a/core/modules/system/tests/src/Functional/Update/WarmCacheUpdateFrom8dot6Test.php b/core/modules/system/tests/src/Functional/Update/WarmCacheUpdateFrom8dot6Test.php
index 663ba96..a0ebdac 100644
--- a/core/modules/system/tests/src/Functional/Update/WarmCacheUpdateFrom8dot6Test.php
+++ b/core/modules/system/tests/src/Functional/Update/WarmCacheUpdateFrom8dot6Test.php
@@ -2,7 +2,6 @@
namespace Drupal\Tests\system\Functional\Update;
-use Drupal\Core\Database\Database;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -41,41 +40,6 @@ class WarmCacheUpdateFrom8dot6Test extends UpdatePathTestBase {
}
/**
- * Tests system_update_8601().
- */
- public function testWithMissingProfile() {
- // Remove the install profile from the module list to simulate how Drush 8
- // and update_fix_compatibility() worked together to remove the install
- // profile. See https://www.drupal.org/project/drupal/issues/3031740.
- $connection = Database::getConnection();
- $config = $connection->select('config')
- ->fields('config', ['data'])
- ->condition('collection', '')
- ->condition('name', 'core.extension')
- ->execute()
- ->fetchField();
- $config = unserialize($config);
- unset($config['module']['minimal']);
- $connection->update('config')
- ->fields([
- 'data' => serialize($config),
- 'collection' => '',
- 'name' => 'core.extension',
- ])
- ->condition('collection', '')
- ->condition('name', 'core.extension')
- ->execute();
-
- $this->runUpdates();
- $this->assertSession()->pageTextContains('The minimal install profile has been added to the installed module list.');
-
- // Login and check that the status report is working correctly.
- $this->drupalLogin($this->rootUser);
- $this->drupalGet('admin/reports/status');
- $this->assertSession()->pageTextContains("Installation Profile Minimal");
- }
-
- /**
* {@inheritdoc}
*/
protected function initConfig(ContainerInterface $container) {