By mstrelan on
Change record status:
Draft (View all draft change records)
Project:
Introduced in branch:
12.0.x
Introduced in version:
12.0.0
Issue links:
Description:
The constants DRUPAL_CORE_REMOVED_MODULE_LIST and DRUPAL_CORE_REMOVED_THEME_LIST have been deprecated from Drupal\system\Install\Requirements\SystemRequirements in favor of a new dedicated class Drupal\system\RemovedCoreExtensionList.
The new class also provides two static helper methods:
RemovedCoreExtensionList::isRemovedModule(string $name): boolRemovedCoreExtensionList::isRemovedTheme(string $name): bool
Before
use Drupal\system\Install\Requirements\SystemRequirements;
// Check membership
if (array_key_exists($name, SystemRequirements::DRUPAL_CORE_REMOVED_MODULE_LIST)) { ... }
if (array_key_exists($name, SystemRequirements::DRUPAL_CORE_REMOVED_THEME_LIST)) { ... }
// Get human-readable label
$label = SystemRequirements::DRUPAL_CORE_REMOVED_MODULE_LIST[$name];
$label = SystemRequirements::DRUPAL_CORE_REMOVED_THEME_LIST[$name];
After
use Drupal\system\RemovedCoreExtensionList;
// Check membership - use the new helper methods
if (RemovedCoreExtensionList::isRemovedModule($name)) { ... }
if (RemovedCoreExtensionList::isRemovedTheme($name)) { ... }
// Get human-readable label - access the new constants directly
$label = RemovedCoreExtensionList::MODULES[$name];
$label = RemovedCoreExtensionList::THEMES[$name];
Impacts:
Module developers