system_requirements() missing extension dependency check calls themes modules

Created on 6 October 2022, almost 3 years ago
Updated 21 May 2025, about 2 months ago

Problem/Motivation

Spin off from #3309319: Manually test upgrade core Classy to contrib Classy β†’ .

The code handles both themes and modules, but both variable names and actual strings say 'module' where they should say 'extension' - or we should vary the text depending on extension type where that's possible (i.e. modules can't depend on themes so that could still say module for missing dependencies).

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

system.module

Created by

πŸ‡¬πŸ‡§United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¦πŸ‡ΊAustralia mstrelan

    system_requirements() is 1556 lines long so it's not immediately obvious which part this is referring to. If I've interpreted this correctly it's this part that needs updating:

    // Check the module's required modules.
    /** @var \Drupal\Core\Extension\Dependency $requirement */
    foreach ($file->requires as $requirement) {
      $required_module = $requirement->getName();
      // Check if the module exists.
      if (!isset($files[$required_module])) {
        $requirements["$extension_name-$required_module"] = [
          'title' => t('Unresolved dependency'),
          'description' => t('@name requires this module.', ['@name' => $name]),
          'value' => t('@required_name (Missing)', ['@required_name' => $required_module]),
          'severity' => REQUIREMENT_ERROR,
        ];
        continue;
      }
      // Check for an incompatible version.
      $required_file = $files[$required_module];
      $required_name = $required_file->info['name'];
      // Remove CORE_COMPATIBILITY- only from the start of the string.
      $version = preg_replace('/^(' . \Drupal::CORE_COMPATIBILITY . '\-)/', '', $required_file->info['version'] ?? '');
      if (!$requirement->isCompatible($version)) {
        $requirements["$extension_name-$required_module"] = [
          'title' => t('Unresolved dependency'),
          'description' => t('@name requires this module and version. Currently using @required_name version @version', ['@name' => $name, '@required_name' => $required_name, '@version' => $version]),
          'value' => t('@required_name (Version @compatibility required)', ['@required_name' => $required_name, '@compatibility' => $requirement->getConstraintString()]),
          'severity' => REQUIREMENT_ERROR,
        ];
        continue;
      }
    }
    
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    I think the original 2 was a mistake

Production build 0.71.5 2024