refactor default severity in preRenderGroupRequirements()

Created on 20 October 2024, 3 days ago

Problem/Motivation

The code in StatusReport::preRenderGroupRequirements() is hard to read:

      $severity = $severities[REQUIREMENT_INFO];
      if (isset($requirement['severity'])) {
        $requirement_severity = (int) $requirement['severity'] === REQUIREMENT_OK ? REQUIREMENT_INFO : (int) $requirement['severity'];
        $severity = $severities[$requirement_severity];
      }
      elseif (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'install') {
        $severity = $severities[REQUIREMENT_OK];
      }

What's actually happening here is:

1. If $requirement['severity'] is set, we use that.
2. If it's not then we use either:
-- REQUIREMENT_OK if we're in install
-- REQUIREMENT_INFO if not

But the default handling is split in two parts of the code which makes it confusing.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

base system

Created by

🇬🇧United Kingdom joachim

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024