The maintenance theme when the database is offline is broken due to development.inc.

When I turn off my database / change the db name in settings.php I get a fatal error when visiting my website.

I have declared the following in my settings.php so my base theme of omega would show some standards messages.

$conf['install_profile'] = 'wetkit';
$conf['maintenance_theme'] = 'wetkit_omega';

The logs I get from apache clearly points to the problem. When I commented out the lines the maintenance theme also worked again.

[Fri Oct 04 00:42:02 2013] [error] [client 192.168.33.1] PHP Fatal error:  Call to undefined function user_access() in /mnt/www/html/wet-boew-drupal/profiles/wetkit/themes/omega/omega/includes/development/development.inc on line 11
[Fri Oct 04 00:42:02 2013] [error] [client 192.168.33.1] PHP Stack trace:
[Fri Oct 04 00:42:02 2013] [error] [client 192.168.33.1] PHP   1. _drupal_exception_handler() /mnt/www/html/wet-boew-drupal/includes/bootstrap.inc:0
[Fri Oct 04 00:42:02 2013] [error] [client 192.168.33.1] PHP   2. _drupal_log_error() /mnt/www/html/wet-boew-drupal/includes/bootstrap.inc:2289
[Fri Oct 04 00:42:02 2013] [error] [client 192.168.33.1] PHP   3. drupal_maintenance_theme() /mnt/www/html/wet-boew-drupal/includes/errors.inc:179
[Fri Oct 04 00:42:02 2013] [error] [client 192.168.33.1] PHP   4. _drupal_maintenance_theme() /mnt/www/html/wet-boew-drupal/includes/bootstrap.inc:2529
[Fri Oct 04 00:42:02 2013] [error] [client 192.168.33.1] PHP   5. _drupal_theme_initialize() /mnt/www/html/wet-boew-drupal/includes/theme.maintenance.inc:74
[Fri Oct 04 00:42:02 2013] [error] [client 192.168.33.1] PHP   6. call_user_func() /mnt/www/html/wet-boew-drupal/includes/theme.inc:214
[Fri Oct 04 00:42:02 2013] [error] [client 192.168.33.1] PHP   7. phptemplate_init() /mnt/www/html/wet-boew-drupal/includes/theme.inc:0
[Fri Oct 04 00:42:02 2013] [error] [client 192.168.33.1] PHP   8. include_once() /mnt/www/html/wet-boew-drupal/themes/engines/phptemplate/phptemplate.engine:14
[Fri Oct 04 00:42:02 2013] [error] [client 192.168.33.1] PHP   9. require_once() /mnt/www/html/wet-boew-drupal/profiles/wetkit/themes/omega/omega/template.php:14
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sylus’s picture

This patch seems to fix things for me.

sylus’s picture

Status: Active » Needs review
sylus’s picture

Updated patch to do this how theme.inc does it in _template_preprocess_default_variables (line 2399).

fubhy’s picture

Status: Needs review » Needs work

Meh. Stupid user module. Why the fuck is such an essential function (access check) part of a module. Oh well, my head is already in D8-land. Anyways, yeah... gotta fix that. However, that second patch won't work. You can't use $user there (it's undefined). I believe you mean $GLOBALS['user']!?

sylus’s picture

Sigh this will teach me to do patch too late during night lol. Oh well latest RC of my distro won't have development plugin working :(

Here is the correct patch.

sylus’s picture

One more time.

rob_johnston’s picture

I think that there a closing brace missing on the last two patches (it was there in #3). Otherwise, I'm getting this error:

Parse error: syntax error, unexpected end of file in D:\internet\drupal_WxT\profiles\wetkit\themes\omega\omega\includes\development\development.inc on line 166

Tested and works here.

sylus’s picture

Thanks @rob_johnston been a rough day lol

fubhy’s picture

Thanks, committed.

fubhy’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

mod