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?

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.