Problem/Motivation

Add new plugin to show message if there are any warnings/errors on the /admin/reports/status page.

Proposed resolution

Create new plugin and have its own config form so that you can choose to show only errors and/or warnings.

Remaining tasks

  1. create patch
  2. review patch
  3. commit patch

User interface changes

The new plugin will show up in the list of allowed messages with a config form.

API changes

N/A

Data model changes

N/A

Comments

Kristen Pol created an issue. See original summary.

kristen pol’s picture

Assigned: darrylri » Unassigned
chrisdarke42’s picture

Assigned: Unassigned » chrisdarke42

Wrote out this plugin, then we realised we needed to change AdminStatus to deal with multiple messages per plugin. Will release once AdminStatus is patched from the relevant ticket

chrisdarke42’s picture

StatusFileSize
new4.99 KB

Based off of the patched version of Admin Status (https://www.drupal.org/node/2722667) that allows for multiple messages for a single plugin instance, here is the patch for this Status Report plugin.

kristen pol’s picture

Thanks! Here are some nitpicks:

  1. +++ b/src/Plugin/AdminStatus/StatusReportError.php
    @@ -0,0 +1,139 @@
    +class StatusReportError extends AdminStatusPluginBase {
    

    I'm not sure it should be called "Error" since aren't there warnings too? Maybe CoreStatusReport? I don't remember what other have been named so far.

  2. +++ b/src/Plugin/AdminStatus/StatusReportError.php
    @@ -0,0 +1,139 @@
    +  var $statem_manager = null;
    

    What is the "m" in "statem"?

  3. +++ b/src/Plugin/AdminStatus/StatusReportError.php
    @@ -0,0 +1,139 @@
    +   *
    

    Extra line.

  4. +++ b/src/Plugin/AdminStatus/StatusReportError.php
    @@ -0,0 +1,139 @@
    +
    

    Extra line.

  5. +++ b/src/Plugin/AdminStatus/StatusReportError.php
    @@ -0,0 +1,139 @@
    +    $form['error'] = array(
    

    Maybe 'error' => 'message_type' or something?

  6. +++ b/src/Plugin/AdminStatus/StatusReportError.php
    @@ -0,0 +1,139 @@
    +    return;
    

    Add a comment why there is no validation done.

  7. +++ b/src/Plugin/AdminStatus/StatusReportError.php
    @@ -0,0 +1,139 @@
    +  protected function translateSeverityToStatus($severity) {
    

    Needs doc block.

  8. +++ b/src/Plugin/AdminStatus/StatusReportError.php
    @@ -0,0 +1,139 @@
    +    switch($severity) {
    

    Space after switch.

  9. +++ b/src/Plugin/AdminStatus/StatusReportError.php
    @@ -0,0 +1,139 @@
    +   * @return array
    

    Description needed.

  10. +++ b/src/Plugin/AdminStatus/StatusReportError.php
    @@ -0,0 +1,139 @@
    +      switch($option) {
    

    Space after switch.

  11. +++ b/src/Plugin/AdminStatus/StatusReportError.php
    @@ -0,0 +1,139 @@
    +        if(in_array($requirement['severity'], $systemSeverities)) {
    

    Space after if.

kristen pol’s picture

Category: Task » Feature request
vinay15’s picture

Status: Active » Needs review
StatusFileSize
new4.69 KB
new8.98 KB

Tried updating the patch.

chrisdarke’s picture

Thanks for Vinay15 for your patch, very close, there were some details that needed correcting however. Here is a patch and interdiff from the original patch, with the variable name corrected as I meant it to be, and the descriptions, spacing etc as Kristen Pol commented on.

kristen pol’s picture

Thanks, @ChrisDarke . That interdiff doesn't appear to be correct.

@Vinay15 - Chris is actively working on this issue (it's assigned to him) but there are other issues that can be worked on. Please check the issue queue for those. Or, if you have ideas for adding new plugins, please open an issue with those ideas. Thanks!

kristen pol’s picture

Issue summary: View changes
StatusFileSize
new257.21 KB

I have tested on simplytest.me and it is showing the warnings/errors as expected.

kristen pol’s picture

I have reviewed the code and have tested the feature using all the checkboxes in on vs off combinations and it works as expected. Marking RTBC. Thanks!

kristen pol’s picture

Status: Needs review » Reviewed & tested by the community
kristen pol’s picture

Issue summary: View changes

kristen pol’s picture

Assigned: chrisdarke42 » Unassigned
Priority: Normal » Major
Status: Reviewed & tested by the community » Fixed

This has been committed! Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.