I'm not sure what version this is appropriate for, but I just noticed a weird bug that I hadn't before. In the root index.php is this code:
// Attachments don't require the entire theme to be loaded.
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach' && (!empty($modSettings['allow_guestAccess']) && $user_info['is_guest']))
detectBrowser();
// Load the current theme. (note that ?theme=1 will also work, may be used for guest theming.)
else
loadTheme();
What I was seeing is that when the server was in maintenance mode, I was getting a ton of errors in the log.
It turned out that the problem was that the dlattach request, which NORMALLY does not need theme and just serves an image to download, was, when maintenance mode was on and user was a guest, instead showing the user a "SITE UNDER MAINTENANCE" page.
But in that case, it was freaking out because the theme was not loaded.
Solution, just add a check on that line to check if they are going to need the theme since we are in maintenance mode:
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach' && (!empty($modSettings['allow_guestAccess']) && $user_info['is_guest']) && (empty($maintenance) || allowedTo('admin_forum'))) {
detectBrowser();
}
// Load the current theme. (note that ?theme=1 will also work, may be used for guest theming.)
else
loadTheme();
Thanks, we'll look into it. IIRC, the code around that case has been switched around a bit, so it might affect only 2.0.16.
Logged #110.