Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#7 | omega_broken_maintenance_page-2104445-7.patch | 913 bytes | rob_johnston |
#6 | omega_broken_maintenance_page-2104445-6.patch | 918 bytes | sylus |
#5 | omega_broken_maintenance_page-2104445-4.patch | 917 bytes | sylus |
#3 | omega_broken_maintenance_page-2104445-2.patch | 902 bytes | sylus |
#1 | omega_broken_maintenance_page-2104445-1.patch | 816 bytes | sylus |
Comments
Comment #1
sylus CreditAttribution: sylus commentedThis patch seems to fix things for me.
Comment #2
sylus CreditAttribution: sylus commentedComment #3
sylus CreditAttribution: sylus commentedUpdated patch to do this how theme.inc does it in _template_preprocess_default_variables (line 2399).
Comment #4
fubhy CreditAttribution: fubhy commentedMeh. 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']!?
Comment #5
sylus CreditAttribution: sylus commentedSigh 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.
Comment #6
sylus CreditAttribution: sylus commentedOne more time.
Comment #7
rob_johnston CreditAttribution: rob_johnston commentedI think that there a closing brace missing on the last two patches (it was there in #3). Otherwise, I'm getting this error:
Tested and works here.
Comment #8
sylus CreditAttribution: sylus commentedThanks @rob_johnston been a rough day lol
Comment #9
fubhy CreditAttribution: fubhy commentedThanks, committed.
Comment #10
fubhy CreditAttribution: fubhy commentedComment #11.0
(not verified) CreditAttribution: commentedmod