| Project: | Drupal core |
| Version: | 7.0 |
| Component: | base system |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | SettingsAPI |
Issue Summary
Hi,
When a user moves/duplicates a site with clean_urls on, caching etc. he is very frequently locked out if he can't get mod_rewrite etc. working. Similarly, with the new Site Offline/Online feature, there doesn't seem to be any option for the admin to turn it off or log back in if he accidentally logs out..
The site/default/settings.php file has a section that allows overriding these DB variables. If the above mentioned variables can be added (and commented out), it might make things a lot easier to rescue the site without having to mess around with serialized variables in the variables table..
<?php
$conf = array(
'site_name' => 'My Drupal site',
'clean_url' => 0,
'clean_url_ok' => 0,
'cache' => 0,
'site_offline' => '0',
);
?>(I'm not entirely sure what clean_url_ok does, but I've added it in anyways..)
If and when all the variables to be added are decided, I'll attach a patch file.
Cheers
Karthik.
P.S User Experience/usability seemed like the best place to put this..
Comments
#1
This is an outstanding idea! I have been in this fix myself, and naturally looked in settings.php to see if there was an override. Having these "safe mode" settings visible and commented out would save a lot of people a lot of headache.
#2
In my settings.php I have the ability to launch the site in safe mode:
/** Safe mode -- launch site with safe settings
*/
if ($ALLOW_SAFE_SETTINGS && isset($_GET['SAFE_SETTINGS'])) {
$conf = array_merge( $conf,array(
'site_name' => trim($_SERVER['HTTP_HOST'],"/").' (SAFE MODE)',
'theme_default' => 'pushbutton',
'clean_url' => 0,
'cache' => 0,
'site_offline' => '0'
));
}
at the beginning of settings.php there is a line allowing disabling safe mode:
// Permits launching the site in "safe mode" by acccesing it with:// http://yourdomain?SAFE_SETTINGS
$ALLOW_SAFE_SETTINGS = TRUE;
#3
@lekei: ah, that's a lot cleaner. But I assume that you're either using Civic or have added this in yourself? It isn't present in standard installations. I'm not sure the _GET is really required though.
Either way, you should make that into a patch and submit it.
Cheers
Karthik.
#4
Patch attached.
-K
#5
I have tried to use your patch however, I receive a blank screen when I installed the patch. What must I do to make this work? This problem with the online, offline function needs to be resolved I know I can't be the only one.
#6
"This problem with the online, offline function needs to be resolved I know I can't be the only one."
That confused me too at first. Until I read you could visit http://localhost/user to get in the back-door login page.
#7
Sounds like a bug or feature request for Drupal not a userland issue.
#8
This should go into 6.x first. I think there should be some comments explaining how these settings might be used.
If you do log out of a site in maintenance mode, just go to .../user/login and log in as user 1, which is allowed. Maybe the UI around that needs to be improved, but that should be handledin another issues.
#9
Moving feature requests to D7 queue.
#10
Moving.
#11
Subscribe-- so the issue here is simply communicating what is possible, correct?
#12
Look for the copious documentation around $update_free_access in default.settings.php.