When I follow the directions for "Theming the maintenance page" (http://drupal.org/node/195435) and set $conf['maintenance_theme'] = 'zen';
in my settings.php, then set my site 'offline' through the maintenance admin page, everything works fine.
But when I turn my database off to simulate DB failure (as suggested in the doc), I get a bunch of SQL warnings, like this:
Warning: mysql_real_escape_string() expects parameter 2 to be resource, null given in /x/x/x/includes/database.mysql.inc on line 321
I can't tell for sure, but is Zen creating these? Or is it something else I did? I haven't hacked anything.
BTW, if I set $conf['maintenance_theme'] = 'minnelli';
in settings.php, no SQL warnings appear.
Comment | File | Size | Author |
---|---|---|---|
#2 | zen-6.x-1.0-hook_theme_fix.patch | 728 bytes | tayzlor |
Comments
Comment #1
tayzlor CreditAttribution: tayzlor commentedI'm seeing this behaviour too, definitely a problem with Zen.
As a test, i copied maintenance.tpl.php into bluemarine and no php warnings showed up at the top of the maintenance page with that theme.
Comment #2
tayzlor CreditAttribution: tayzlor commentedin the hook_theme() function for zen, theme is trying to query the database, resulting in php warnings on the maintenance page when the database is down.
provided patch to check if db is active or maintenance page is up.
thanks
graham.
Comment #3
JohnAlbinSweet! I love patches. I'll review this weekend if no others get to it first. :-)
Comment #4
yoroy CreditAttribution: yoroy commentedGentle bump :-)
Comment #5
JohnAlbinI believe this issue is complicated by this core bug: #341140: drupal_get_filename() when database is down, does not deal with phptemplate themes
Comment #6
mr.baileysMarked #317409: not considering possible missing database connection: drupal_get_path('theme', 'zen') as a duplicate of this one since this one contains a patch.
Comment #7
JohnAlbinThe patch in #2 doesn't work. With it, I get a multiple warnings when rebuilding the theme registry.
I've committed a simpler patch.