Inform users that the maintenance mode message is not displayed on cached pages

Created on 22 September 2016, about 8 years ago
Updated 23 August 2024, about 2 months ago

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 ๐Ÿ› Inform users that the maintenance mode message is not displayed on cached pages Needs review .

message added to admin/config/development/maintenance form

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.

๐Ÿ› Bug report
Status

RTBC

Version

11.0 ๐Ÿ”ฅ

Component
Baseย  โ†’

Last updated about 4 hours ago

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Pipeline finished with Canceled
    3 months ago
    Total: 381s
    #240221
  • Pipeline finished with Success
    3 months ago
    Total: 609s
    #240226
  • Status changed to Needs review 3 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vinmayiswamy

    Hi, I have tested and verified the changes 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 detailed steps I took to ensure the changes are correctly implemented:

    1. Verification of page_cache_form_system_site_maintenance_mode_alter Hook:
    2. * Form Field Description Update:
      * Navigation: Accessed the Maintenance Mode form through Administration > Configuration > System > Maintenance mode(/admin/config/development/maintenance).
      * Description Check: Verified that the description for the maintenance mode message field now includes the text: "To display the maintenance mode message to all site visitors, flush the page cache on the Performance Settings page."
      * URL Validation: 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. * Enable Maintenance Mode:
      -- Successfully enabled maintenance mode on the same form.
      * Success Message Verification:
      -- Submission: Submitted the form with maintenance mode enabled.
      -- Message Display: Verified that the success message displayed after submission reads: "To display the maintenance mode message to all site visitors, flush the page cache on the Performance Settings page."
      -- Link Verification: Confirmed that the link within the success message correctly directs to the Performance Settings page.

      Cache Clearing: After testing, cleared the site cache using Administration > Configuration > Performance to ensure the updates were visible.

      All changes have been verified and are functioning as intended. The form now correctly displays the updated description, and the success message includes the relevant information and link. The cache was cleared to reflect these changes immediately.

      Attached screenshots for reference.
      Before MR

      After MR

      Status message on form submit:

      Performance settings page:

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

      Thanks!

  • Status changed to RTBC 2 months ago
  • ๐Ÿ‡ง๐Ÿ‡พBelarus krakenbite
  • Issue was unassigned.
  • Status changed to Needs work 2 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    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.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vinmayiswamy

    Hi, It appears that the screenshots I attached in comment #62 ๐Ÿ› Inform users that the maintenance mode message is not displayed on cached pages Needs review were either missed or accidentally deleted. To ensure that everything is in place, I am re-uploading the screenshots here.
    Thanks!

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    Usability review

    We discussed this issue at ๐Ÿ“Œ Drupal Usability Meeting 2024-08-09 Needs work . 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 Kazakhstan

    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].

  • Pipeline finished with Success
    2 months ago
    Total: 821s
    #256526
  • Pipeline finished with Success
    2 months ago
    Total: 900s
    #256543
  • Status changed to Needs review 2 months ago
  • Status changed to Needs work 2 months ago
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    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.

  • Status changed to Needs review 2 months ago
  • ivnish Kazakhstan

    @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

  • Pipeline finished with Success
    2 months ago
    Total: 696s
    #257035
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    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 Kazakhstan

    I use Ubuntu 22.04

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mradcliffe USA

    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.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    Prashant.c โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 158s
    #259150
  • Pipeline finished with Failed
    about 2 months ago
    Total: 157s
    #259159
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    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!

  • Pipeline finished with Success
    about 2 months ago
    Total: 474s
    #259167
  • Status changed to Needs work about 2 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    For the issue summary mentioned in #74

  • Status changed to Needs review about 2 months ago
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    updated the image in the issue summary per the suggestion in #77 ๐Ÿ› Inform users that the maintenance mode message is not displayed on cached pages Needs review

  • Status changed to RTBC about 2 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mradcliffe USA

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

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    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.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    @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.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

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

    Updating credit

  • ivnish Kazakhstan

    And the MR is implementing a solution from the UX review

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

Production build 0.71.5 2024