In the drupal_maintenance_theme function on line 879 of bootstrap.inc.
/**
* Enables use of the theme system without requiring database access. Since
* there is not database access no theme will be enabled and the default
* themeable functions will be called. Some themeable functions can not be used
* without the full Drupal API loaded. For example, theme_page() is
* unavailable and theme_maintenance_page() must be used in its place.
*/
I have successfully overridden the maintenance page theme and have tested it by putting my site offline and it works. The problem is that when I change the db connect string to something invalid it goes to the default theme instead of picking up the custom theme. It looks like this is not the intended behavior based on the comment in the bootstrap.inc file.
Comments
Comment #1
marcingy commentedDo you mean that the site remains in maintainence mode or that you get a different page displayed entirely?
Comment #2
jeffabailey commentedIt stays in maintenance mode but instead of showing the custom theme it shows the drupal default maintenance page when there is no valid database connection.
Comment #3
marcingy commentedIf the database connection string is incorrect the site has no idea that it is in fact in maintainence mode - the value is stored in a database table. By simply changing the string to an incorrect value a page stating 'Unable to select database' is displayed. Without a valid database connection drupal has no knowledge of what theme you are using because this value is held in the database. As a result I don't believe this can be change or is indeed a fault - you could amend the theme function directly in theme.inc if you want to change the theme (I'm not advising that). The idea behind the maintainence page is that you can take down a site and limit access to the admins while you perform an upgrade of an existing site.
Comment #4
jeffabailey commentedI imagined that there was a reason for it. I'll see about modifying the theme.inc file then. Thanks.