Issue
In system_theme_suggestions_maintenance_page(), a template suggestion is provided for maintenance-page--offline.html.twig:
if ($offline) {
$suggestions[] = 'maintenance_page__offline';
}
However, this template is not picked up when the system is offline. This results in a WSOD, creating a poor user experience. This is functionality that did exist and work in Drupal 7, and an attempt was made to have this functionality ported to Drupal 8, but appears to not have been completed/successful. Therefore this is a bug report.
Steps to reproduce
Situation A (when core/includes/errors.inc is used):
- Set correct database credentials in settings.php
- Clear cache: drush cr
- Set $config['system.logging']['error_level'] = 'hide' in settings.php
- Set $settings['maintenance_theme'] = 'bartik' in settings.php
- Set incorrect database credentials in settings.php (for example invalid username)
- Refresh the page.
- There is a plain text message: "The website encountered an unexpected error. Please try again later."
Situation B (when \Drupal\Core\EventSubscriber\FinalExceptionSubscriber is used):
- Make sure that $settings['hash_salt'] in set in settings.php
- Clear cache: drush cr
- Set $config['system.logging']['error_level'] = 'hide' in settings.php
- Set $settings['maintenance_theme'] = 'bartik' in settings.php
- Comment out $settings['hash_salt'] in settings file
- Refresh the page.
- There is a plain text message: "The website encountered an unexpected error. Please try again later."
Priority Level
From the status description for major issues:
Cause a significant admin- or developer-facing bug with no workaround.
This is a significant bug and there is no workaround at the moment, and therefore is a major issue.