I tried checking the maintenance mode box and "save configuration" but the site does not go offline. Yes, it tells me it's now offline, but it's lying. When I check in another browser, I can still see the site contents. Any help would be appreciated.

Comments

ddarras2012’s picture

I ran into the same issue with Bartik. Following this the recommendation in this thread ($conf['maintenance_mode'] = FALSE;) as well as switching to Stark resolved the immediate issue. maintenance-page.html.twig is the template file although copying that directly into the root "themes" directory didn't change anything. It stands to reason that there's a step I'm missing or that Bartik's template file has an issue. Hope that helps.

Utkarsh Harshit’s picture

settings.php contains the following line in Drupal8-

# $settings['maintenance_theme'] = 'bartik';
First, uncomment this setting and change "bartik" to the machine name of your custom theme.

Next, copy the core maintenance template core/modules/system/templates/maintenance-page.html.twig to templates/maintenance-page.html.twig in your custom theme directory.

Lastly, flush the Drupal cache to enable your new maintenance page template. If you need alter the template's variables, you can add the MYTHEME_preprocess_maintenance_page() to your theme file.

It might help you.

Utkarsh Harshit’s picture

Hi,
Clear/Flush caches (drush all) and try again. If you already did that and did not work add a page preprocess function to your default theme.
It might help you.

Egmund’s picture

This seems like a bug to me. Having the same problem, but clearing the caches fixes it. This can not be the intended behavior.

darvanen’s picture

Actually, I think most people would prefer Drupal to show cached pages rather than a maintenance message where it's able during updates. If you want to display the maintenance page on a long-term basis you'll need to clear cache.