There are some places in the core documentation pointing to maintenance mode and database offline (theme suggestions etc.).
So I'm not sure, if this is a bug report or feature request.

I'm not able to render fatal errors via the maintenance offline template - like an unavailable database.
The content set from drupal_log_error() in errors.inc::251 gets output: "The website encountered an unexpected error. Please try again later.<br />" (full response)
→ in Drupal 7 one was able to do so ;)

Setup:

  • $config['system.logging']['error_level'] = 'hide';

Template in mytheme/templates

  • (maintenance-page.html.twig)
  • maintenance-page--offline.html.twig

Am I missing anything?

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

seppelM created an issue. See original summary.

kiwimind’s picture

Seeing the same thing here and haven't found a way to get it to work yet.

There's a suggestion in system_theme_suggestions_maintenance_page in core/modules/system/system.module, which looks like it should work, but doesn't.

NikLP’s picture

Yeah this does look like a bug of sorts, the folks in #drupal-uk tried all sorts of things and couldn't get a template working, even putting a forced template in core/modules/system/templates

seppelM’s picture

Like I wrote, fatal errors are directly output without any "rendering",
except within the installation process → install_display_output() which calls drupal_maintenance_theme()
(@see errors.inc ~ 251)

- Maybe a plain .html file, to get around non-catchable needed services like Twig or dependent ones?
- otherwise render the --offline.html.twig which is enriched with "static" twig template variables or $config (settings.php)?

seppelM’s picture

Any update on this issue?

jenny.cha’s picture

Has anyone found an alternative solution to create a custom offline maintenance page? There hasn't been an update on this issue for about 7 months now...

cilefen’s picture

Version: 8.1.1 » 8.3.x-dev

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Jaypan’s picture

Priority: Normal » Major

Changing the status to major, as the system outputs a WSOD in the case of a fatal error, which is horrible UI. This fits into the status description for major due to this:

Cause a significant admin- or developer-facing bug with no workaround.

This is a significant bug and there is no workaround at the moment.

ekl1773’s picture

zeuty’s picture

First of all, steps to reproduce the issue.
Situation A (when core/includes/errors.inc is used):
1. Set incorrect database credentials in settings file.
2. Refresh the page.

Situation B (when core/lib/Drupal/Core/EventSubscriber/FinalExceptionSubscriber is used):
1. Comment out $settings['hash_salt'] in settings file
2. Refresh the page.

The patch adds a possibility to have a twig template that styles fatal errors described in A and B.

zeuty’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 12: theming-fatal-errors-2720109-12.patch, failed testing. View results

Ivan Berezhnov’s picture

Issue tags: +CSKyiv18

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.