Problem/Motivation

When site maintenance mode enabled while page cache module also enabled most visitors continue to get cached pages.

Proposed resolution

Add notice to site maintenance form when page cache module enabled pointing to clear cache to show message to all visitors.

Remaining tasks

commit

User interface changes

The resolution is confirmed from a review at a Usability team Slack meeting (@AaronMcHale, @amazingrando, @benjifisher, @rkoller, @simohell, and @zetagraph). A previous proposed resolution was to also include a message on the form submit, but this would add clutter / confusion to the user interface. Read more in comment #63.

message added to admin/config/development/maintenance form

 the site is now in maintenance mode. the maintenance mode message will not shown on already cached pages. to clear the cache visit performance page

API changes

no

Data model changes

no

Release notes snippet

TBD

Original report

When i recently upgraded Drupal 8.1.8 to 8.1.10, i turned on "Maintenance mode" for the site, but it only worked after i "cleared all caches" in Configuration->Development->Performance menu. I think this is a bit confusing. Maintenance mode should override or clean the cache, because it's important that it works while something is updated.

This ticket may be considered a "feature request", but I believe, drupal does not go into maintenance mode because of this issue, when one does "online module update", ticking the option "Update in maintenance mode".

Proposed solution: Add a note to the Maintenance mode page about this:

Since the page cache is enabled, you must flush the page cache to display your maintenance mode message to site visitor. Visit the performance settings page to flush the page cache.

Issue fork drupal-2804387

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

vakorol created an issue. See original summary.

jaheer3’s picture

Assigned: Unassigned » jaheer3
jaheer3’s picture

Assigned: jaheer3 » Unassigned

Hi,
I tried to replicate this issue but I did not find any. I followed the steps below.

1. I installed an instance of drupal-8.1.8.
2. I put the site in Maintenance mode.
3. I upgraded the version to drupal-8.1.10.
4. disable the maintenance mode

It worked fine in my system. Can you please describe specific steps you followed?

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)
vakorol’s picture

Steps to reproduce on 8.1.8:
1. enable Maintenance mode
2. go to the front page (i do that in other browser, just for a clean test)
3. The front page does not show "Site in maintenance mode" message.
4. clear all caches.
5. After that the front page correctly displays the message about maintenance mode.

The same happens when I use "online upgrade module" feature (recently for module Colorbox, for example) - i put the tick "upgrade in maintenance mode", then proceed with the module upgrade. During the process, main page does not show "maintenance mode" message.

vakorol’s picture

I encountered the same behavior when updating 8.1.10 to 8.2.3. The maintenance mode was not enabled until i "cleared all caches".

vakorol’s picture

Priority: Minor » Normal
hongpong’s picture

Status: Postponed (maintainer needs more info) » Active

Re opening this because this is a problem a lot of people ran into, see https://www.drupal.org/forum/support/post-installation/2017-06-10/drupal...

There is a problem here because some of us want to be able to use maintenance mode to hide a site. (what's the point of having a maintenance mode feature if pages are still showing after it's enabled?) I think it is poor UI to have the maintenance mode message phrased this way

It is not obvious that an additional step of cache clearing is needed.

The UI may need an additional checkbox "Flush caches to actually get it into maintenance mode".

Some loosely related issues I found:

jepster_’s picture

Priority: Normal » Major

It's very confusing, that your site is not in maintenance mode until you flush the cache. Also the form is confusing. Because the checkbox is not enabled until you flush the cache. There should be a message like "You must flush the cache to get into maintenance mode".

Setting the priority to "Major", because the maintenance mode is a crucial core feature and exists since Drupal 8.0.

sleitner’s picture

+1 there should be a message or the cache should be flushed when saving

sleitner’s picture

Version: 8.1.8 » 8.6.x-dev
vakorol’s picture

Update: this is still an issue in Drupal 8.6.2.

I think the most intuitive solution would be to clear the caches automatically when enabling the maintenance mode.

jepster_’s picture

Status: Active » Needs review
StatusFileSize
new642 bytes

I have implemented the cache flush after the maintenance mode has been enabled. Please review.

tstoeckler’s picture

Priority: Major » Normal
Status: Needs review » Needs work

Discussed this with @Peter Majmesku and @webflo during the Global Sprint Weekend. @webflo brought up the point that it might actually be OK to still serve cached pages without flushing it. It seems that only Page Cache is affected by this, I was not able to reproduce this issue with Page Cache disabled.

@Peter Majmesku brought up that this still might be confusing for people, so we thought it would be good for Page Cache module to form-alter a notice to that form warning about this behavior.

webflo’s picture

+++ b/core/modules/system/src/Form/SiteMaintenanceModeForm.php
@@ -103,6 +103,10 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
+      drupal_flush_all_caches();

Flushing all caches is not necessary imo. The "'http_response" cache tag should be sufficient.

jepster_’s picture

Status: Needs work » Needs review
StatusFileSize
new1.56 KB

Here's a different patch, which displays an info regarding necessary cache flush for showing up the maintenance mode message to users. Please review.

jepster_’s picture

Version: 8.6.x-dev » 8.7.x-dev
StatusFileSize
new1.08 KB

Removed unnecessary if-check from patch and added string to not break translation.

tstoeckler’s picture

Version: 8.7.x-dev » 8.6.x-dev
Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs text review
StatusFileSize
new187.57 KB
+++ b/core/modules/page_cache/page_cache.module
@@ -29,3 +30,10 @@ function page_cache_help($route_name, RouteMatchInterface $route_match) {
+  $form['maintenance_mode']['#description'] .= ' <p>' . t('Since the page cache is enabled, you must flush the page cache to display your maintenance mode message to site visitor. Visit the <a href="@performance-page-url" title="performance settings page">performance settings page</a> to flush the page cache.' . '</p>', ['@performance-page-url' => Url::fromRoute('system.performance_settings')->toString()]);

I think the explicit toString() is not necessary, it will be cast to string automatically.

Also adding a screenshot for some review of the interface text hopefully by a native speaker and tagging accordingly.

tstoeckler’s picture

Version: 8.6.x-dev » 8.7.x-dev
jepster_’s picture

Status: Needs work » Needs review
StatusFileSize
new1.07 KB
new1.07 KB

Removed toString() call.

Here's the screenshot. May any native speaking person would review the spelling, please?

Since the page cache is enabled, you must flush the page cache to display your maintenance mode message to site visitor. Visit the performance settings page to flush the page cache.

jepster_’s picture

tstoeckler’s picture

Thanks, the patch looks good to me!

The last submitted patch, 16: 2804387-cache-flush-info.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

leandro713’s picture

patch #17 works for me

Status: Needs review » Needs work

The last submitted patch, 20: 2804387-cache-flush-info.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

mmbk’s picture

This problem comes from the page-cache in combination with the maintenance mode - It probably will also happen when maintenance mode is set from drush. (Does drush clear caches when switching to maintenance?)
I wonder whether it would make sense to switch off page-cache completely when the site is operating in maintenance mode?

berdir’s picture

I guess there are two different reasons for setting maintenance mode. The main use case is IMHO to disable possibly broken functionality while running updates. Unless page cache would be broken too, it seems like a good thing that cached responses are still returned.. it means you have fewer non-working page requests.

If you're using it to somehow on purpose disable a site then you might want to stop serving cached pages, but something like the proposed message seems good enough to me, force-clearing the cache or disabling page cache seems problematic and would result in more downtime, also for (large) sites behind reverse proxies that propagate cache clears to that proxy. I think in almost all cases, you want to have as little actual downtime as possible.

mradcliffe’s picture

Since the page cache is enabled, you must flush the page cache to display your maintenance mode message to site visitor. Visit the performance settings page to flush the page cache

  1. We need to use an article such as "the" or "a" for the singular "to site visitor". At the moment it reads like "site visitor" is the name of something. Or, in my opinion, we can omit the article and use plural.
  2. Should "performance settings" be capitalized to match the schema label for system.performance, or match the page title which is "Performance" only?

Some Bike shedding:

I wonder if it's okay to omit the first part of this sentence as well in order to keep the message/sentence short.

"You must flush the page cache to display your maintenance mode message to site visitors."

Or if it is necessary, then sometimes it reads better with the explanation at the end of the sentence.

"You must flush the page cache to display your maintenance mode message to site visitors since the page cache is enabled." puts the instructional part of the text.

chewie’s picture

Problem is reproducible and I believe is important.
As for me adding additional comment (with obligation for site maintainer to clear cache) for now this is work around.
It should be fixed properly.

mmbk’s picture

Version: 8.7.x-dev » 8.6.x-dev
Priority: Normal » Major
Status: Needs work » Needs review

We (Dresden: pminf,mmbk,akoe) believe that the cache should be flushed automatically.
If the administrator MUST flush the cache, to prevent front-end users from accessing the site, there seems to be no reason to make this optional and ask him to flush the cache.

Convinced, it's better to leave available as long as possible

mmbk’s picture

Version: 8.6.x-dev » 8.7.x-dev
Priority: Major » Normal
Status: Needs review » Needs work

SORRY

chewie’s picture

StatusFileSize
new2.3 KB

Here is patch that could solve problem. Will wait tests.
I have found that this is just solution. And actually for now this is not cover executing by drush. I will do this later. So we have to invalidate cache properly moment (on state change or configuration update).

chewie’s picture

StatusFileSize
new2.18 KB
jepster_’s picture

@mradcliffe #28: Thanks! I have improved the spelling according to your suggestions.

Also I have improved the code, for not breaking tests.

@Chewie: As @Berdir wrote in #27 it's important to not flush the page cache in any case. Because the site owner might want to have as little downtime for pages as possible. When maintenance mode is enabled, the pages will be delivered from the page cache. If you do not want this, you must flush the page cache. Therefor I have created the patch.

That's how the maintenance page will look like after my patch has been applied:
Image

jepster_’s picture

Status: Needs work » Needs review
berdir’s picture

Yes, for updates, there is no reason to force visitors to see the maintenance method. If they still get a cached working page then that's a good thing, I don't understand why you think differently?

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs text review

OK, looks good to me. I think #28 was sufficient textual review I think, so marking RTBC.

catch’s picture

Issue tags: +Needs usability review

Tagging for usability review for the new text.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update

I think the issue title here is misleading. Maintenance mode is enabled - it's only the maintenance mode message that is not being displayed because the cache is hit. I suggest something like Inform users that the maintenance mode message is not displayed on cached pages - also the issue summary needs updating to reflect that.

Also I think there possibly should be further discussion about the multiple uses of maintenance mode. I think that this bug report has arisen from the expectation that you can use the maintenance mode to mothball a site whereas its intended purpose it give the site a small window to make updates before coming back online. Therefore it is developed in such a way to preserve the appearance of a working site.

+++ b/core/modules/page_cache/page_cache.module
@@ -29,3 +30,11 @@ function page_cache_help($route_name, RouteMatchInterface $route_match) {
+/**
+ * Implements hook_form_FORM_ID_alter().
+ */
+function page_cache_form_system_site_maintenance_mode_alter(&$form, FormStateInterface $form_state, $form_id) {
+  $form['maintenance_mode_message']['#description'] = t('Since the page cache is enabled, you must flush the page cache to display your maintenance mode message to the site visitor. Visit the <a href=":performance-page-url" title="performance settings page">Performance Settings page</a> to flush the page cache.', [':performance-page-url' => Url::fromRoute('system.performance_settings')->toString()]);
+}

I think this message can be improved by being shorter and more explicit. Something like Flush the page cache on the <a href=":performance-page-url" title="performance settings page">Performance Settings page</a> to display the maintenance mode message to all site visitors.".

I'm not a fan of including the word "must" in this message because it sounds like something a user has to do whereas the opposite is true. It is a much rarer use-case that someone should flush the page cache. The 80%+ use-case of maintenance mode is the current behaviour. (I'm pretty sure of this because we are asking people to use maintenance mode for all core updates).

alexpott’s picture

Hmmm my suggested message can be improved too :) by putting the most important bit of information first.

To display the maintenance mode message to all site visitors, flush the page cache on the <a href=":performance-page-url" title="performance settings page">Performance Settings page</a>."

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

andypost’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new1.56 KB
new852 bytes
new15.48 KB

#40 is more straight - changed, started to clean-up issue summary

Also I found inconsistency in how "FORM-ID" hooks documented (probably needs follow-up to normalize

ivnish’s picture

I think also we need to show message about cache to messages region after save settings. It's good UI/UX for new Drupal 8 site builders.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

tonytheferg’s picture

This approach of just changing the message seems a little weird. We use maintenance mode when we don't want people using the site during updates, db backups etc... The default behavior has always been permission based access only as the current description implies. Was there an explicit decision to serve any pages whatsoever aside from the maintenance page, when in MM?

As a I think about it, why is that not a test? If a user doesn't have permission, there should only be 2 pages available, MM page, and login.

I think the bug should be fixed, and those who want an additional feature to cache pages can open up a separate feature request if they want.

:)

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

gagarine’s picture

Adding a addition checkbox « clear the cache when in maintenance mode. Without clearing the cache visitors keep access to cached pages during maintenance mode but cannot login.  ».

The checkbox should be a settings and save it’s last state. I think it should be checked by default.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

isa.bel’s picture

StatusFileSize
new1.72 KB
new51.03 KB

I believe that the best UX a user can have is when they can decide by themselves what to do. If you add the message below the text area, in my POV the user might just ignore that and think that it's already working as designed (the maintenance page is already showing for all users) and adds another step to the user workflow, when it can be simplyfied. So I do agree that a checkbox it's the best option here, as we give the user the ability to choose whether they want the cache to be cleared or not, and also give an easy option to choose the best option.

Therefore I'm attaching the patch that I created to add this checkbox and ability to clear cache, with the description that provides the proper explanation for the reason why this would be necessary.

maintenance mode screenshot

prasanth_kp’s picture

StatusFileSize
new54.72 KB
new60.19 KB

#53 Applied successfully on drupal 10.1.x-dev

alexpott’s picture

Status: Needs review » Needs work

I think the suggestion to display a further message telling people to clear the cache form #43. I don't think adding a another checkbox here is a good one. Because a checkbox is for a state change but this is not a a state change. If you didn't want to clear the cache you set it to off press save and then it'd be set to on again. That's not how checkboxes are supposed work.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

ivnish’s picture

Assigned: Unassigned » ivnish

ivnish’s picture

Status: Needs work » Needs review
Issue tags: -Drupal 8.x
ivnish’s picture

Title: Maintenance mode enabled only after clearing cache » Inform users that the maintenance mode message is not displayed on cached pages
Issue tags: -Needs issue summary update
ivnish’s picture

Issue summary: View changes
vinmayiswamy’s picture

Hi, I have tested and verified the changes in MR !9015 related to the page_cache_form_system_site_maintenance_mode_alter hook and the success message after submitting the maintenance mode form. Below are the details of my verification process:

  1. Verification of page_cache_form_system_site_maintenance_mode_alter Hook:
  2. Form Field Description Update:
    - Verified that the description for the maintenance mode message field now includes: "To display the maintenance mode message to all site visitors, flush the page cache on the Performance Settings page."
    - Confirmed that the URL in the description correctly points to the Performance Settings page (/admin/config/development/performance).

  3. Verification of Success Message After Form Submission:
  4. After enabling maintenance mode:
    - Verified that the success message reads: "To display the maintenance mode message to all site visitors, flush the page cache on the Performance Settings page."
    - Confirmed that the link in the success message directs correctly to the Performance Settings page.

Cache Clearing: Cleared the site cache via Administration > Configuration > Performance to ensure visibility of the updates.

The form now correctly reflects the updated description, and the success message includes the appropriate information and link. All changes have been verified and are functioning as expected.

Attached screenshots for reference.

Before MR
Before-MR-2804387

After MR
After-MR-2804387

Status message on form submit:
Status-message-on-form-submit-2804387

Performance settings page:
Performance-settings-page-2804387

Kindly please let me know if any additional steps are needed.

Edit: Re-uploaded the missing screenshots.

Thanks!

krakenbite’s picture

Status: Needs review » Reviewed & tested by the community
ivnish’s picture

Assigned: ivnish » Unassigned
catch’s picture

Status: Reviewed & tested by the community » Needs work

This doesn't look right to me, I would put back to needs more info but I can see that happened years ago and it was re-opened, could definitely use UX review and there's also one technical issue in the MR.

If we really need to add a message, I would just tell people what happens rather than what to do, e.g. 'Cache pages will still be served to anonymous site visitors unless the cache is cleared' or something.

vinmayiswamy’s picture

Hi, It appears that the screenshots I attached in comment #62 were either missed or accidentally deleted. To ensure that everything is in place, I am re-uploading the screenshots here.
Thanks!

rkoller’s picture

Issue tags: -Needs usability review

Usability review

We discussed this issue at #3465362: Drupal Usability Meeting 2024-08-09. That issue will have a link to a recording of the meeting. For the record, the attendees at today's usability meeting were @AaronMcHale, @amazingrando, @benjifisher, @rkoller, @simohell, and @zetagraph.

If you want more feedback from the usability team, a good way to reach out is in the #ux channel in Slack.

After some discussion we had a clear consensus on removing the description underneath the Message to display when in maintenance mode text field. Since less is more, the line adds to the visual clutter, is redundant with the status message, and most important encourages the user to do things in the wrong order. Meaning, the user might read the description while the site is not in the maintenance mode yet, follows the link, clears the cache, comes back to the maintenance page, sets the site to maintenance mode and saves the form.

In regards of the status message, there are currently two of them when a site goes into maintenance mode. First The configuration options have been saved. placed by the system module and second the newly added To display the maintenance mode message to all site visitors, flush the page cache on the Performance Settings page. placed by the page cache module.
Ideally, if technical possible, the consensus was to combine the two status messages into a single one. We had a draw and no clear consensus about the wording of the entire message. The two candidates are:

  1. The site is now in maintenance mode. Cached pages will not show the maintenance mode message. To clear the cache, visit the [Performance page].
  2. The site is now in maintenance mode. The maintenance mode message will not show on already cached pages. To clear the cache, visit the [Performance page].

The first sentence The site is now in maintenance mode. simply informs the user about the actual current state the site is in - the site is in maintenance mode. Which is more informative and specific than the generic information that the configuration options have been saved currently used. For the first sentence we had a clear consensus.

There was also a consensus about the third sentence To clear the cache, visit the [Performance page].. We tried to keep the wording consistent used on /admin/config/development/performance and /admin/config/development/maintenance. The performance page uses the verb clear instead of flush<code>. The concept of <code>page cache might be also too abstract and/or advanced for the person in charge, the performance page only talks about clearing cache in general and it is not necessarily important information for the status message on the maintenance page that page cache is cleared. And we've changed the link title from Performance settings page to performance page since /admin/config/development/performance is only titled performance.

The second sentence was the reason why we were drawn between suggestion 1 and 2. The thing we are trying to explain the consequences of a site being in maintenance mode. We wanted to convey that as long as there pages that were cached BEFORE the site got into maintenance mode the maintenance mode message page wont be shown to them. Cuz there could be the case that someone who is working on something while the site is maintenance mode wants that the user is still able to access the information on the page normally, while someone else wants that the maintenance mode message is directly shown and informs the user that the site is in maintenance mode instead. We are unable to know what the user's preferred choice is. But based on the information provided with suggestion 1 and 2 the user is able to make an informed decision. With the first sentence they know the site is in maintenance mode. With the second sentence they know that cached pages wont show the maintenance mode message. So based on the third sentence the user then has the knowledge to directly go to the performance page in case the person wants to ensure that the maintenance mode message is directly shown to everyone.

In case it is not possible to combine all three sentences into a single status message the recommendation would be as follows. Change The configuration options have been saved. in the system module to The site is now in maintenance mode.. And change the status message introduced with this MR from To display the maintenance mode message to all site visitors, flush the page cache on the Performance Settings page. to either:

  • Cached pages will not show the maintenance mode message. To clear the cache, visit the [Performance page].
  • The maintenance mode message will not show on already cached pages. To clear the cache, visit the [Performance page].

Since we had no clear consensus about the second sentence yet, we've agreed on continuing the discussion, - curious what you all think? I'll remove the needs usability review tag.

ivnish’s picture

I like the second text

The site is now in maintenance mode. The maintenance mode message will not show on already cached pages. To clear the cache, visit the [Performance page].

ivnish’s picture

Status: Needs work » Needs review
rkoller’s picture

Status: Needs review » Needs work

Just one note. When i wanted to test the latest changes i ran into an issue i've already experienced on another MR. When i try to checkout the feature branch i run into the following error:

$> git checkout 2804387-maintenance-mode-enabled
error: The following untracked working tree files would be overwritten by checkout:
	core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Connection.php
	core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Install/Tasks.php
	core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysqlDeprecatedVersion/Connection.php
	core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysqlDeprecatedVersion/Install/Tasks.php
	core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Connection.php
	core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Install/Tasks.php
Please move or remove them before you switch branches.
Aborting

It is due to a recent commit to core https://git.drupalcode.org/project/drupal/-/commit/8b368d712d83900765744... . (DrivertestMysql changed to DriverTestMysql and DrivertestPgsql changed to DrivertestPgsql - and i am on a none case sensitive file system with macos). To fix this the issue needs a rebase. I'll set the issue back to needs work.

ivnish’s picture

Status: Needs work » Needs review

@rkoller I updated the fork, but have no problems with conflicts. Looks like your local git problem. Try to reset to head and discard/remove conflicting files

rkoller’s picture

Thanks for the rebase. No removing these files doesn't help much, that was the initial short term fix we've tried. The only thing that properly solves the problem is a rebase. and it looks like that this error will show up for every feature branch in every MR that was created before the mentioned commit https://git.drupalcode.org/project/drupal/-/commit/8b368d712d83900765744... went in and which havent had a rebase after it went in. according to @rfay the problem is the none case sensitive macos filesystem causing the error due to the switch to camel case in the aforementioned linked commit. out of curiosity on which operating system are you @ivnish?

and thanks to your rebase i was able to git fetch the branch and then able to checkout without any issues. thanks again! and i was now able to take a look at the MR again now. The status message is now a single message, the description got removed underneath the "message to display"-field, and you have updated to one of the suggested status messages. so all the concerns we've raised in the usability meeting are covered. looks fab, thanks a lot!

i would give a +1 for RTBC, since personally i dont have a strong opinion for either of the two status message suggestions (i am fine with each of them), but i leave the status at needs review a little longer in case someone else has a strong opinion for the other. but for me this looks good to go.

ivnish’s picture

I use Ubuntu 22.04

mradcliffe’s picture

Issue summary: View changes
Issue tags: +Needs issue summary update

I removed the UX review task in the issue summary and added a note about it in the User interface changes section.

I added the Needs issue summary update tag for further updates to the User interface changes section to update the screenshot.

Prashant.c made their first commit to this issue’s fork.

prashant.c’s picture

One more thing I realized is that because the message to inform the admins about maintenance mode not enabled for cached pages until the cache clear is done, is shown on form submit only, the admin might miss it and refresh or navigate away.

Therefore, it might make sense to display this message permanently till the site is in maintenance mode and every time the admin visits the /admin/config/development/maintenanceform.
Thanks!

smustgrave’s picture

Status: Needs review » Needs work

For the issue summary mentioned in #74

rkoller’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new96.02 KB

updated the image in the issue summary per the suggestion in #77

mradcliffe’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs issue summary update

Removing Needs issue summary update tag and setting status to RTBC because I think recent comments were addressed.

ivnish’s picture

Priority: Normal » Major

One month as RTBC :)

smustgrave’s picture

Priority: Major » Normal

Probably shouldn't elevate issues just to get looked at.

Core committers are group of volunteers each with their own stuff going on. RTBC queue is about 115 currently so things may not immediately get merged.

quietone’s picture

@ivnish, the requirements for setting the priority for an issue are explained on Issue Priority field page of the handbook. A link to that page can also be found in the 'Issue metadata' section of each issue. Cheers.

quietone’s picture

I do not see any unanswered questions here. And the MR is implementing a solution from the UX review, #67

Updating credit

ivnish’s picture

And the MR is implementing a solution from the UX review

@quietone after the review I implemented suggestions in MR (17 Aug 2024)

catch’s picture

Status: Reviewed & tested by the community » Needs work

Two further questions on the MR.

ivnish’s picture

@catch please answer

catch’s picture

ivnish’s picture

Status: Needs work » Needs review

I moved the code to the page_cache module as @catch suggested

jepster_’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. Good job ivnish. Thanks!

This is only a status message. We are discussing this as a community since 9 years. This proves that we are super pedantic and lacking project management skills. Please merge this change finally.

poker10’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Thanks for working on this.

I manually tested the MR since there are no tests to prove that the message is actually shown. It worked as expected. Anyway, I think we should extend the existing SiteMaintenanceTest to check if the code is working as expected and to prevent regressions in the future, especially if we are "blindly" removing original status message(s).

I also have some additional questions:

1. Aren't we worried that we could potentially remove more messages when using this code \Drupal::messenger()->deleteByType(MessengerInterface::TYPE_STATUS);? For example if there will be any custom messages included. We are not checking the actual message being removed.

2. Route system.site_maintenance_mode has permissions of administer site configuration+administer software updates, which means that if you have only administer software updates, you still have access to the maintenance mode form. But if you do not have administer site configuration permission, the newly added link to the Performance page will not work. Are we OK with keeping it there even if the user won't have access to it?

ivnish’s picture

@poker10

I don't like idea to removing previous messages. As I know Drupal (and symfony) can't remove message by ID or text. But without removing we have 2 messages and messages region shows twice. Any ideas how to fix it?

poker10’s picture

I discussed this with @catch on committers Slack channel.

We both think that removing all messages without knowledge what else could be there is a bit risky. Even if the risk is small, it could affect some sites UX negatively, if any unrelated message will be removed accidentally. Another disadvantage is, what @ivnish asked in #91, that there is no way to remove just the one message, we need to change. Adding another message (and have two here) does not seems right.

I re-read the whole issue and it seems like, that the initial proposal was to add a description to the message textarea and only later it was proposed to add also a message on form submit. Based on this, the usability team proposed to remove the description and stick only with updating the submit message(s). However, the initial intention was to add only something simple like this: To display the maintenance mode message to all site visitors, flush the page cache on the Performance Settings page..

When we started mixing it with the submit message, it ended up as: The site is now in maintenance mode. The maintenance mode message will not show on already cached pages. To clear the cache, visit the Performance page.. Which is different from the original meaning, which was just to inform a user about caching. The current message also informs a user that the maintenance mode is turned on, which I think should not be in the scope of this issue, because we already have a similar message informing users about the active maintenance mode, see: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co... (Operating in maintenance mode...). This message is intentionally excluded from the system.site_maintenance_mode route (see #184926: Incorrect message displayed when bringing a site back online). I do not think that we should add the information about the maintenance mode status back to the form, as users already see whether the checkbox is checked, or not. Or at least we should not do it in this issue.

Considering all this, I propose to return back to the original proposal - do not change submit message(s) and just add a simple and easy-to-read description to the message textarea (and do this only if page_cache module is enabled). Something like The message will not show on already cached pages without clearing the page cache.. I propose a bit different wording for the last part, so that we do not need to deal with the possible different permissions of the user (see #90.2). Another option discussed on a Slack was to put all information in the form, depending on the current state.

I am adding Needs usability review tag again and will ask for another opinion from the usability team based on these new findings.

Thanks!

ivnish’s picture

Assigned: Unassigned » ivnish
ivnish’s picture

Assigned: ivnish » Unassigned
Status: Needs work » Needs review
krakenbite’s picture

Status: Needs review » Reviewed & tested by the community
rkoller’s picture

Usability review

We discussed this issue at #3546438: Drupal Usability Meeting 2025-09-19. That issue will have a link to a recording of the meeting. For the record, the attendees at the usability meeting were @jannafiester, @joannajackson, @rkoller, and @simohell

If you want more feedback from the usability team, a good way to reach out is in the #ux channel in Slack.

The removal of the status message based on the rational provided in #92 sounded like a reasonable step for us if that is fixing the outlined problems including the one in #91. The change of the micro copy to the new description is ok, except it is a bit unspecific by referring only to "message"

But the way bigger problem with this change from our point of view is that the description is very very had to notice. We have skimmed through comment #92 at the beginning of the meeting and then took a look at the maintenance page on a test site with MR9015. For context two of us attended the review about one year ago only vaguely remembering the details at best, the other two looked at the issue for the very first time, so all of us looked at this issue with some fresh pairs of eyes. We've searched for an extended period of time for the introduced changes, at the end we even had two windows open, one without the MR and one with the MR, and we were still unable to notice that the description of the text field contained the change (reminded me a bit about the video of that selective attention test https://www.youtube.com/watch?v=vJG698U2Mvo). as a last resort before asking over here on the issue we've taken a look at the merge request; copied the string for the description to the clipboard and then searched on the maintenance page for that string - that way we were able to finally find the change. The reason why we haven't noticed the change was probably due to a combination of reasons; the description is at the very end of the page, it is a description for a text field, and the font size is very tiny for an important detail like that - the information has a very low information scent. If you take into consideration that sighted users usually don't read a page but skim most of the time, the odds are rather low that they will notice the information. but it might not be solely challenging for sighted users, screenreader users might also jump off early on right after the text field label "message to display when in maintenance mode" was announced. they might think "ahhh this is the field for the message displayed in maintenance mode i can jump off now". so either way, the descriptions might get missed by sighted users and/or screenreader users.

Probably in part out of scope for this issue, but our discussion shifted towards the general order of components on the maintenance page when we've tried to come up with a suggestion how to communicate the information introduced in this MR.

Currently we have, first the help text, then the checkbox to put the site into the maintenance mode, and finally the textfield. From our point of view the more logical order would be a) help text b) textfield c) checkbox , that way you consciously pass and validate the maintenance mode message before you set the site into the actual maintenance mode - currently you have to jump back and forth in regard to the reading order.

With a change of the component order the microcopy might also be rearranged. the description currently used on the checkbox is strictly speaking about the general behavior of the maintenance mode, something a help text is about, while the description introduced with this MR is about a CTA for the admin to clear the cache after the site is set into the maintenance mode.

An initial suggestion for the help text might be as follows - moving the string currently used on the checkbox into the help text:

Use maintenance mode when making major updates, particularly if the updates could disrupt visitors or the update process. Examples include upgrading, importing or exporting content, modifying a theme, modifying content types, and making backups. 
Only users with the "Use the site in maintenance mode" permission will be able to access the site. Authorized users can log in directly via the user login page. Visitors will only see the maintenance mode message. It will not show on already cached pages without clearing the page cache.

the description for the checkbox would be a more specific variant of the string currently used on text field description of this MR:

The maintenance mode message will not show on already cached pages without clearing the page cache.

The rearrangement and rephrasing of the help text is just an initial draft to convey the general idea, we haven't had enough time left during the meeting to hone the micro copy. But the basic idea was to move the description of the checkbox into the help text. The added part outlines the general behavior of the maintenance mode in regard to permissions, first about who can login and then who can view what. The last sentence of the "who can view" is sort of redundant to the description of the checkbox but that was a deliberate choice. It is an important detail and by having it be addressed twice, the odds are getting higher that the detail wont go unnoticed, after there is no proper way to highlight that detail visually more prominently aside using a status message.

How to proceed? if others agree to the general direction we've suggested, we could revisit the issue in the next meeting and do some more word smithing, in case no one else beats us to it. And talking of general direction we were also uncertain how to chop the proposed changes up, cuz the reordering of components is most likely out of the scope for this issue?

jepster_’s picture

For me (and obviously others) the current solution is good enough. Let's not over engineer and wait 9 years more. I pledge for RTBC.

quietone’s picture

After reviewing this again and reading the conversation of catch and poker10 there are two approaches here. One is to follow the recommendations of the Usability team, which includes some out of scope ideas, and the other is to add description text to the maintenance mode text field. I lean strongly to respecting the expertise of the Usability team and to stay in scope. So, I would prefer to change the description text to what is recommended in #96 and in a follow up issue explore the other points in #96.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Given #96 and #98 this issue needs work. I think the suggestion in #98 to change the description to the suggested text in this issue and file a follow-up to address the rest makes sense to me.

ivnish’s picture

Status: Needs work » Needs review

I applied suggestions from #96.

rkoller’s picture

thanks you for the updates. i've pulled the latest changes but when i try to clear caches with drush i run into a fatal php error:

PHP Fatal error: Uncaught Error: Class "Doctrine\Common\Annotations\TokenParser" not found in /var/www/html/repos/drupal/core/lib/Drupal/Component/Annotation/Doctrine/StaticReflectionParser.php:192

the issue probably needs another rebase due to recent changes in 11.x (#3550917: doctrine/annotations is abandoned)

ivnish’s picture

I rebased the MR. All tests passed.

sahilps6’s picture

Suggestion : Divide as per the intent of text, to make it more scalable to eyes. Example below.
https://www.figma.com/design/yxXkBgG8uvgxHJFWLwnuGC/Drupal.org?node-id=7...

benjifisher’s picture

Status: Needs review » Needs work
Issue tags: -Needs usability review +Needs issue summary update

Usability review

We discussed this issue at #3557881: Drupal Usability Meeting 2025-11-21. That issue has a link to a recording of the meeting. I am giving issue credit here to the attendees: @anmolgoyal74, @benjifisher, @pallavi singh3013, @rkoller, @sahilps6, @simohell, and @the_g_bomb.

@ivnish, thanks for the updates since the last review (Comment #96). We looked at the results, and we recommend making three tweaks:

  1. Start a new paragraph with "Only users ..." instead of using a <br> tag.
  2. Make "permission" a link to /admin/people/permissions/module/system (permissions for the system module) instead of the generic permissions form. (The route is user.admin_permissions.module with the parameter modules => system.)
  3. Change "Visitors" to "Other visitors". (This sentence used to be the start of the help text. Now that it is in a paragraph after two sentences that mention authorized users, it makes sense to exclude them explicitly.)

In addition to those recommendations, we have a suggestion (already mentioned in Comment #103). We think it will make the two paragraphs of help text easier to scan if we add a header to each paragraph. If you take this suggestion, then I guess the headers should use <h2> elements to preserve the page hierarchy. So the text would look something like this:

When to use maintenance mode

Use maintenance mode when making major updates, ...

Access during maintenance mode

Only users with the "Use the site in maintenance mode" permission ...

I am adding the tag for an issue summary update. Under "User interface changes", we should have an updated "after" screenshot. Since this issue rearranges the text, it will be helpful to add a "before" screenshot as well.

If you want more feedback from the usability team, a good way to reach out is in the #ux channel in Slack.

benjifisher’s picture

Another point that was raised in the 2025-11-21 usability meeting is that the current approach informs the user about caching. Looking at the comments, there are some suggestions to recommend clearing caches. We like the current approach (informing without making a call to action). Depending on how the site is used, it might be a good thing to let most visitors see the cached content instead of the maintenance message.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.