Problem/Motivation
When maintenance mode is active, the site maintenance message is renderen in a particular theme. That theme can be set explicitly in setings.php otherwise the default theme is used. If something goes wrong, however, when determining the default theme, for example because the database goes away during an update, we need some fallback theme to display the maintenance message.
This (last-resort) fallback theme is currently Bartik. As part of the effort to make Claro the default admin theme and eventually deprecate Batrik we should also change this fallback theme to Claro instead.
Steps to reproduce
- Change the default theme to something other than Bartik.
- Activate maintenance mode and somehow trigger an exception during the fetching of the default theme. You can do this by editing
core/includes/theme.maintenance.incand addingthrow new \Exception('my exception');at line 44 (inside thetryblock). - You will see the maintenance message rendered in Bartik.
Proposed resolution
Change the fallback to Claro.
Remaining tasks
User interface changes
The fallback site maintenance message is rendered in Claro.
API changes
-
Data model changes
-
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | interdiff.txt | 1.06 KB | lauriii |
| #17 | 3262674-17.patch | 1.98 KB | lauriii |
| #16 | Site_under_maintenance___Drupal-2.png | 41.86 KB | mherchel |
| #15 | Site_under_maintenance___Drupal.png | 14.56 KB | mherchel |
| #13 | interdiff_12-13.txt | 1.99 KB | cindytwilliams |
Comments
Comment #2
tstoecklerMarked this postponed as I assume we want to do this after #3219959: Update standard profile so Olivero is the default theme but this could in principle be done at any time. We just have to remove the @todo-hunk added here for now to make the test pass.
One note: The test would have passed even without changing the markup assertion, because both Bartik and Olivero put the maintenance message in an element that matches "main h1". But to make the test a bit more meaningful I thought it makes sense to assert for some markup that is Olivero-specific.
Comment #3
tstoecklerComment #4
tstoecklerComment #5
tstoecklerWeird, had that locally at some point but must have gotten lost. Neat that our test suite catches this, though 👍
Comment #6
tstoecklerComment #7
quietone commentedAdding a parent.
And no longer postponed.
Comment #9
lauriiiI think we should consider whether it makes sense to use Olivero as the fallback maintenance theme. Olivero provides a much more opinionated experience compared to Bartik, which might not fit in for all sites. It makes sense to provide this opinionated experience when using Olivero, but this simply doesn't fit in as well to use with other themes.
Olivero:

Bartik:

I think we could get an experience closer matching the old behavior if we enabled Claro as the fallback maintenance theme. The Claro designs are also more neutral which has a better chance of fitting into the sites brand.
Claro:

Comment #10
lauriiiTagging for product manager feedback on #9.
Comment #11
gábor hojtsyI think being in maintenance mode is a backend situation either way, so showing the backend a bit is not bad, especially as a super last resotrt like here. If the database went away, etc. we don't know if Olivero is even enabled or used, so we can't programatically decide if showing that would make sense. However Claro's maintenance experience is more restraied and generally applicable indeed.
Comment #12
ravi.shankar commentedAdded a patch for Drupal 9.5.x, as patch #5 is not applied to 9.5.x., still needs work for #11.
Comment #13
cindytwilliams commentedHere is a patch that addresses #11 and updates the patch to use Claro as the fallback maintenance theme instead of Olivero.
Comment #14
mherchelEditing issue summary
Comment #15
mherchelThis patch in #13 looks perfect to me. Thanks @cindytwilliams!
Before screenshot

Comment #16
mherchelAfter picture:

Comment #17
lauriiiReverted the changes to
\Drupal\Tests\system\Functional\System\SiteMaintenanceTestbecause I don't think the changes there were doing what they were originally intended to do.Comment #21
lauriiiCommitting my own patch since the changes were very minor, and essentially just reverted changes from a test.
Committed 047faa3 and pushed to 10.1.x. Cherry-picked to 10.0.x and 9.5.x. Thanks!