Problem/Motivation

Hi. First of all thanks for all your hard work on this. I was planning to build something very similar and to my joy you already did that :) Thanks!

To the problem. If one adds ReportNotFound block to the dashboard while dblog module is not installed (watchdog table is missing), one gets the WSOD with the following error:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydb.watchdog' doesn't exist: SELECT COUNT(DISTINCT("message")) AS "expression" FROM "watchdog" "watchdog" WHERE "type" = :db_condition_placeholder_0; Array ( [:db_condition_placeholder_0] => page not found ) in Drupal\dashboards\Plugin\Dashboard\ReportNotFound->buildRenderArray() (line 73 of modules/contrib/dashboards/src/Plugin/Dashboard/ReportNotFound.php).

Steps to reproduce

  1. Ensure dblog is not installed
  2. Create dashboard
  3. Add "Top 404 pages" block to the dashboard

Proposed resolution

The block must ensure dependencies are in place before trying to run a query. If dependencies are not met, dashboard should either show an error message or a block should be hidden.

Comments

zaporylie created an issue. See original summary.

zaporylie’s picture

Issue summary: View changes

  • Erik Seifert committed df836cc on 2.1.x
    Issue #3314797: WSOD if ReportNotFound dashboard plugin is in use but...

  • Erik Seifert committed 09610f4 on 2.1.x
    Issue #3314797 by zaporylie, Erik Seifert: WSOD if ReportNotFound...
Erik Seifert’s picture

Add a message if report is used. Not the best option but is okay for existing installations.

Erik Seifert’s picture

Status: Active » Fixed
zaporylie’s picture

Title: WSOD if ReportNotFound dashboard plugin is in use but dblog module isn't enabled » WSOD if watchdog table dependent Dashboard plugin is in use but dblog module isn't enabled
Status: Fixed » Needs work

Thanks for this quick fix. I just noticed this is also the case for another plugin - ErrorReport - which is not covered by the fix above.

  • Erik Seifert committed 9ca86a8 on 2.1.x
    Issue #3314797 by zaporylie, Erik Seifert: WSOD if watchdog table...
Erik Seifert’s picture

Good catch. Thx

Erik Seifert’s picture

Check the other plugins. Seems to be okay.

Erik Seifert’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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