Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
Seven theme
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Nov 2009 at 14:36 UTC
Updated:
7 Dec 2009 at 10:30 UTC
Jump to comment: Most recent file
Comments
Comment #2
marcvangend@testbot: I'm sorry.
Comment #4
cweagansIt was missing the -p flag.
Comment #5
marcvangendDisregard #4, cweagans kindly rerolled it, but against page.tpl.php instead of maintenance-page.tpl.php.
Comment #6
cweagansJust noticed that. This one is against the maintenance page.
Comment #7
marcvangendDear testbot, here is a new patch, now with -p flag and unix line endings. Thank you for your patience :-)
Comment #8
marcvangendLOL
@cweagans: I thought you went to sleep?
Comment #9
cweagansWell ya' know....I code in my sleep sometimes. I actually got called back to my workstation to quickly deploy a Drupal site that I built this morning and I noticed emails coming in =P
Comment #11
marcvangendI still don't get it. Re-submitting cweagans' #6 to see if that does pass the test.
Comment #12
yched commentedNo go. update.php uses this variable to ensure messages are not displayed on batch progress pages, where they'll be overlooked, but delayed at the end of the process.
Comment #13
marcvangend@yched: OK, so in that case, Minnelli was "wrong" all this time for not checking for the $show_messages variable? Anyway, if the check for $show_messages is needed, we should set $show_messages = TRUE for the installation process.
Comment #14
yched commentedOops, I was too quick:
template_preprocess_maintenance_page() does:
So it seems that the $show_messages variable is indeed irrelevant in the template itself.
Comment #15
marcvangendI'm probably missing something, but here is what I don't understand:
The code in template_preprocess_maintenance_page() means that $message will only have a value (and return TRUE in an if statement) if $show_messages is TRUE.
In that case, this line of code in maintenance-page.tpl.php
<?php if ($show_messages && $messages): ?>would be checking
if (TRUE == TRUE), right?Comment #16
yched commentedNot exactly. template_preprocess_maintenance_page() makes it so that $messages will never be true if $show_messages is false.
So
if ($show_messages && $messages):is logically equivalent toif ($messages):.It looks as if the logic of checking $show_messages has been moved up into the preprocessor at some point, but the template not updated accordingly.
Note that garland's page.tpl.php, and seven's page.tpl.php and maintenance-page.tpl.php all check $show_messages, so the 3 of them should be fixed, I think. system.module's own page templates (i.e Stark) just print $messages.
Comment #17
webchickThis is pretty bad. :P
Comment #18
marcvangend@yched #16: I understand. Maybe my explanation wasn't clear enough, but that's exactly my point. If
<?php if ($show_messages && $messages): ?>is logically equivalent to<?php if ($messages): ?>, then why would the patch solve the problem?Comment #19
marcvangendOK I found it. The key to understanding the messages in the installation process is in theme.maintenance.inc, function theme_install_page(), around line 133:
That means that the messages for the install pages are not processed in template_preprocess_maintenance_page() at all, but in theme_install_page().
I think we can be sure that $show_messages is always processed correctly before the tpl.php is processed, so $show_messages should never be checked in a page template. I'm attaching a new patch which corrects this in both Seven and Garland. (Fingers crossed, I think this patch will pass! :-))
Comment #20
marcvangendOne more patch; in garland/page.tpl.php,
print $messagesdoesn't need to be wrapped in an if-statement at all.Comment #21
marcvangend(just a better title)
Comment #22
chx commentedin page preprocess already deals with this var so no need to use it in the template.
Comment #23
webchickAwesome work! Not only does this fix a bug, it cleans up the template files significantly!
Committed to HEAD. :D
Comment #24
marcvangendNice, thanks everyone. Now we only have to do #638430: Error in error message not readable so the error message will actually be readable :-)