Implement new hook_requirements_alter()

Created on 3 March 2022, over 3 years ago
Updated 1 August 2025, 24 days ago

Problem/Motivation

When "Trusted reverse proxy" module is enabled and configured correctly, the following error is shown in the "Status report" page:

Notice: Undefined index: severity in trusted_reverse_proxy_preprocess_status_report_page() (line 18 of modules/contrib/trusted_reverse_proxy/trusted_reverse_proxy.module).
trusted_reverse_proxy_preprocess_status_report_page(Array, 'status_report_page', Array) (Line: 287)
Drupal\Core\Theme\ThemeManager->render('status_report_page', Array) (Line: 422)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 241)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 54)
Drupal\trusted_reverse_proxy\StackMiddleware\TrustedReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

  • Download and install a fresh Drupal 9 core
  • Download and install the Trusted Reverse Proxy module
  • Set the correct configurations in settings.php
  • Clear the cache, and visit the status page

Proposed resolution

Adding the "severity" key in the system.install file should be the correct solution, but at least we can start checking if the severity key exists before extracting it on line 17 of the .module file

Remaining tasks

Implement the patch and create the fork

User interface changes

No

API changes

No

Data model changes

No

πŸ› Bug report
Status

Needs work

Version

1.0

Component

Code

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.

Production build 0.71.5 2024