It is possible that using a rule with "User is going to view a page" as the event cause Maintenance Mode to show up with no theme, no css.
A theory is that Rules is initializing theme during bootstrap.
See this thread: http://drupal.org/node/374645#comment-1306636
Someone else should test this before it's marked as active...
Comments
Comment #1
fagoDoes it so, independent from what action/condition you configure? Could you try an empty rule?
Comment #2
eidolon nightConfirmed on Drupal 6.10 with Beta 5 of Rules. A completely empty rule that is merely triggered each time a user views a page kills all styling on the maintenance page.
It also screws up the blocks page. If you're using an administration theme it prevents any other theme from loading on the blocks page.
Comment #3
j4h8 commentedHi,
I can confirm its screwing up the block admin page on Drupal 6.12 running Rules 6.x-1.0.
How can I assist in fixing this behaviour? Which info do you need?
Regards,
Jutta
Comment #4
fagoNothing, I think the problem is that a call to t() - probably done by the logging system - initializes the theme system to early. I need to have a look at that.
Comment #5
crea commentedYou are right, Rules module calls t() in hook_init, which calls theme('placeholder') , which invokes init_theme() too early.
I believe this is critical since it breaks site administration. When you can't configure your blocks it is confusing as hell.
This also probably means that "User is going to view a page" event should not have "show message" action, cause it uses t() too. Probably, any output in this event should be forbidden, cause in Drupal all output should go through theme layer.
Even more, most actions use t() anyway so we should either make workaround for this, or disable most actions for this event, leaving only custom php action. And if someone is confident enough to use custom php action, atleast he will do it conciously and it will be his responsibility to deal with consequences of such action.
Would be nice to put big, bold warning at that event, like "Note, that this event is invoked in hook_init() and you shouldn't use any Drupal functions that would cause unexpected theme system init."
Comment #6
friolator commentedsubscribing.
Comment #7
fagoI just fixed that. Now the theme system is only initialized if an action does so or the rules debug evaluation is shown. I've done so by avoid '%' replacements in t(), which initialize the theme. I've also added a help text to the rules "A user is going to view a page" action.
Comment #8
mrfelton commentedjust to confirm the bug and that the fix works. Thanks