Allow adding to "General System Information" on "Status report"

Created on 23 February 2024, about 1 year ago

Problem/Motivation

On the "Status report", the five boxes in the "General System Information" are hard-coded in status-report-general-info.html.twig. This means that if a developer wants to add a box, they need to override this template. There should be an easier way.

Example use case: We are making a custom web app for a client. We want the version and other information about the app prominently displayed on the status page. We currently use hook_requirements() to add this to the "Checked" section of "Status Details". We would like something more prominent.

Proposed resolution

Refactor status-report-general-info.html.twig so that it is looping through an array of items. Setup the items in a preprocess function. This allows developers to add to this section in their own preprocess function.

Remaining tasks

Agree on how it should work. Implement.

User interface changes

None.

API changes

None, except that sections can be added via preprocess.

Data model changes

None.

Release notes snippet

Feature request
Status

Active

Version

11.0 🔥

Component
System 

Last updated about 1 hour ago

No maintainer
Created by

🇨🇦Canada Liam Morland Ontario, CA 🇨🇦

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

Merge Requests

Comments & Activities

  • Issue created by @Liam Morland
  • First commit to issue fork.
  • First commit to issue fork.
  • Pipeline finished with Failed
    6 months ago
    Total: 226s
    #292842
  • Pipeline finished with Failed
    6 months ago
    Total: 385s
    #292845
  • 🇮🇳India KumudB Ahmedabad

    While checkout to this current branch, getting this below error, Drupal version 11.x

    The website encountered an unexpected error. Try again later.
    
    Error: Class "Drupal\system\Element\RenderElementBase" not found in include() (line 14 of core/modules/system/src/Element/StatusReportPage.php).
    Composer\Autoload\{closure}() (Line: 427)
    Composer\Autoload\ClassLoader->loadClass()
    class_exists() (Line: 96)
    Drupal\Component\Plugin\Factory\DefaultFactory::getPluginClass() (Line: 17)
    Drupal\Core\Plugin\Factory\ContainerFactory->createInstance() (Line: 83)
    Drupal\Component\Plugin\PluginManagerBase->createInstance() (Line: 166)
    Drupal\Core\Render\ElementInfoManager->createInstance() (Line: 135)
    Drupal\Core\Render\ElementInfoManager->buildInfo() (Line: 91)
    Drupal\Core\Render\ElementInfoManager->getInfo() (Line: 356)
    Drupal\Core\Render\Renderer->doRender() (Line: 240)
    Drupal\Core\Render\Renderer->render() (Line: 238)
    Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 627)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 231)
    Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 128)
    Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
    Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
    call_user_func() (Line: 111)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 186)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 60)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
    Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 736)
    Drupal\Core\DrupalKernel->handle() (Line: 19)
  • Pipeline finished with Failed
    28 days ago
    Total: 133s
    #445197
  • 🇺🇸United States oo0shiny

    I've updated the code to reflect the change in D11 that was causing the error. I think this should be working now.

  • 🇺🇸United States oo0shiny

    Created a version for 10.3 as well.

  • Pipeline finished with Failed
    26 days ago
    Total: 159s
    #446808
  • Pipeline finished with Failed
    26 days ago
    Total: 112s
    #446816
  • 🇺🇸United States oo0shiny

    Here's the 10.3.x patch for anyone who needs it.

Production build 0.71.5 2024