diff --git a/core/includes/update.inc b/core/includes/update.inc index 7cacba384d3a1d75a7df84632fd86bf51cb4d961..4b45b27b65f1a65603d5ab33ebea8ca02dcd4349 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -9,38 +9,8 @@ */ use Drupal\Component\Graph\Graph; -use Drupal\Core\Update\UpdateKernel; use Drupal\Core\Utility\Error; -/** - * Disables any extensions that are incompatible with the current core version. - * - * @deprecated in Drupal 8.8.4 and is removed from Drupal 9.0.0. - * - * @see https://www.drupal.org/node/3026100 - */ -function update_fix_compatibility() { - @trigger_error(__FUNCTION__ . '() is deprecated in Drupal 8.8.4 and will be removed before Drupal 9.0.0. There is no replacement. See https://www.drupal.org/node/3026100', E_USER_DEPRECATED); - // 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) { - foreach ($extension_config->get($type) as $name => $weight) { - if (update_check_incompatibility($name, $type)) { - $extension_config->clear("$type.$name"); - $save = TRUE; - } - } - } - if ($save) { - $extension_config->set('module', module_config_sort($extension_config->get('module'))); - $extension_config->save(); - } -} - /** * Tests the compatibility of a module or theme. */ diff --git a/core/tests/Drupal/KernelTests/Core/Update/CompatibilityFixTest.php b/core/tests/Drupal/KernelTests/Core/Update/CompatibilityFixTest.php deleted file mode 100644 index eb51f496898b0e63b1da7a560de9f2ad323dbb08..0000000000000000000000000000000000000000 --- a/core/tests/Drupal/KernelTests/Core/Update/CompatibilityFixTest.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -namespace Drupal\KernelTests\Core\Update; - -use Drupal\KernelTests\KernelTestBase; - -/** - * Tests that extensions that are incompatible with the current core version are disabled. - * - * @group Update - * @group legacy - */ -class CompatibilityFixTest extends KernelTestBase { - - /** - * {@inheritdoc} - */ - protected static $modules = ['system']; - - protected function setUp(): void { - parent::setUp(); - require_once $this->root . '/core/includes/update.inc'; - } - - /** - * @expectedDeprecation update_fix_compatibility() is deprecated in Drupal 8.8.4 and will be removed before Drupal 9.0.0. There is no replacement. See https://www.drupal.org/node/3026100 - */ - public function testFixCompatibility() { - $extension_config = \Drupal::configFactory()->getEditable('core.extension'); - - // Add an incompatible/non-existent module to the config. - $modules = $extension_config->get('module'); - $modules['incompatible_module'] = 0; - $extension_config->set('module', $modules); - $modules = $extension_config->get('module'); - $this->assertTrue(in_array('incompatible_module', array_keys($modules)), 'Added incompatible/non-existent module to the config.'); - - // Add an incompatible/non-existent theme to the config. - $themes = $extension_config->get('theme'); - $themes['incompatible_theme'] = 0; - $extension_config->set('theme', $themes); - $themes = $extension_config->get('theme'); - $this->assertTrue(in_array('incompatible_theme', array_keys($themes)), 'Added incompatible/non-existent theme to the config.'); - - // Fix compatibility. - update_fix_compatibility(); - $modules = $extension_config->get('module'); - $this->assertFalse(in_array('incompatible_module', array_keys($modules)), 'Fixed modules compatibility.'); - $themes = $extension_config->get('theme'); - $this->assertFalse(in_array('incompatible_theme', array_keys($themes)), 'Fixed themes compatibility.'); - } - -}