Skip to content

Maintenance Mode is active even if the user is logged in #1883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
marck-consulting opened this issue Sep 21, 2020 · 6 comments
Closed

Maintenance Mode is active even if the user is logged in #1883

marck-consulting opened this issue Sep 21, 2020 · 6 comments

Comments

@marck-consulting
Copy link

If I active maintenance mode (maintenance_mode: true in config.yaml) this maintenance page is visible for everyone (logged in or not) instead of being just visible to users that are not logged in.

Details

Question Answer
Relevant Bolt Version 4.0.0 RC 42
Install type Composer install
PHP version 7.4
Web server Apache
For UX/UI issues Safari Version 13.1.3 (15609.4.1)
@bobdenotter
Copy link
Member

I've been thinking about this, and i'm not entirely sure we should "fix" this. If an authenticated user can see the site while it's in maintenance mode, i'm positive a lot of people will be putting their sites in maintenance mode, and then forgetting to turn if off because thhey can just see the frontend.

Fixing this itself won't be hard (add a check for a user in src/Event/Subscriber/MaintenanceModeSubscriber.php), but i'd like to bump this for right now.. To fix this properly, we'll need to make it extra visible in both front- and backend that the site is still in Maintenance.

For now, you can use the "preview" option from the backend to view single pages, whilst maintenance is on.

@marck-consulting
Copy link
Author

Sure that is an option for now. As a recommendation I would suggest solving this need to make it visible by adding something like the "edit-this-page"-Button from Ivo's extension to the page. Like a big "MAINTENANCE" in red letters at the lower right corner or something should do the trick in my opinion.

@I-Valchev
Copy link
Member

We can also use the configuration notices to warn admins that the site is in maintenance mode.

When we think about this more on 4.1, should we allow an option for admins to get out of maintenance mode without having to ssh to the server to edit the config?

@bobdenotter
Copy link
Member

It is in configuration notices, but not everybody will have that installed. From the v3 days, I know that a bunch of developers will actively want to remove it, because they feel they don't need it. (which is true, until they do ;-) )

@andysh-uk
Copy link
Contributor

andysh-uk commented Oct 19, 2020

Just joining with my opinion here (as I was affected by this today), a reason I would want to put a site in maintenance mode is because I want to make changes (new content, re-arrange content, apply updates, etc.) without this being visible to external users.

If I cannot see my site whilst it's in mainenance mode, there is no way I can test the site is working after an upgrade, or my content is linked and appearing correctly, without putting it live for everyone.

Also the comment in the default config.yaml is misleading compared to the current functionality 😉

# Toggle maintenance mode on or off. Note: If you're logged in, you'll still see
# the website as usual. Use an incognito window to see the "maintenance" page.

Drupal sorts the issue of the admin not realising the site is in maintenance by putting a banner on every page - whether it's in the admin, or on the front-end of the site, so there is no way you can miss it.

Also to @I-Valchev:

When we think about this more on 4.1, should we allow an option for admins to get out of maintenance mode without having to ssh to the server to edit the config?

Admins can amend this using the config editor for config.yaml (Configuration > Main Configuration) in the Bolt admin UI, can't they? Or are you thinking something easier?

@bobdenotter
Copy link
Member

This was fixed in #2376

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants