Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
request processing system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Nov 2014 at 12:58 UTC
Updated:
3 Dec 2014 at 17:04 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #1
dawehnerHAHA, this is looking not too bad :p Is this about missing assets or about the wrong order of assets? Just curious.
Comment #2
amateescu commentedThere are no css files from Seven in
<head>(except for the 'seven/install-page' library) so I'd say missing :)Comment #3
yesct commentedComment #4
wim leersOh no :( Earlier while working on the patch, I manually tested the installer to verify that it was all working. So it must've been one of the later refactorings to the patch that caused this. I'll take a look at this unless somebody beats me to it.
Comment #5
alexpottCan confirm this is an issue.
This is what we are missing.
Comment #6
alexpottThis patch fixes the issue and adds a test. Not sure it is the correct fix - should we add the hook firing ability to BareHtmlPageRenderer?
Comment #8
wim leersIt's not; we specifically don't want to fire
hook_page_attachments()fromBareHtmlPageRenderer.The root cause is that this
attaches a library, but the
seven/install-pagedoesn't declare a dependency on the Seven theme's other CSS. We should convert Seven theme'sstylesheetsproperty into alibrariesproperty, just like we've done for Bartik already many months ago.Comment #9
alexpottWell yes but - what about maintenance page styling? Shouldn't we be ensuring that that theme's stylesheets are being added?
Comment #10
alexpottHere's a patch to make the library but this feels super fragile since the maintenance page and the install pages are only get styles because of
seven_preprocess_maintenance_pageandseven_preprocess_install_page. If a theme is set as the maintenance theme is it not reasonable to expect that that theme's stylesheets are added?Comment #11
almaudoh commentedThis is from another issue :)
Comment #13
lewisnymanAre we saying that the stylesheets property is unreliable and every CSS file has to be added into a library? This would be the case for any theme that could be used during the install process right?
Comment #14
alexpottRe #13 yep - which is why I kinda disagree with the fix.
Rerolled patch in #10 properly and fixed tests.
Comment #15
lewisnymanComment #16
fabianx commentedThis is a tricky one.
Theoretically we could treat every theme as a library internally like 'theme/seven' and automatically add a dependency to that "library" where we also add the active theme cache tag.
OR we go the route and deprecate direct JS / CSS usage and go more into the route of libraries everywhere, which has other major performance advantages as suggested by Wim.
The patch here is good, but the whole system feels still fragile.
Comment #17
xjm#2377357: Several big visual regressions in installer was marked as duplicate. Bumping to critical as per that issue; the failed encoding of language names is just embarrassing. :)
Comment #18
gábor hojtsyYeah due to the failed encoding it is impossible to pick the right language unless you know how your language name looks when incorrectly encoded as Latin-1, such as this screenshot for Turkish before / current:
Comment #19
alexpottSo the patch in #6 fixes the language encoding too.
Comment #20
alexpottWhereas the library approach does not.
Comment #21
gábor hojtsyBringing into multilingual sprint because this makes it impossible to pick many of the languages in the installer and know what you picked.
Comment #22
alexpottBut there are other issues with
BareHtmlPageRendererand the installer:<html lang="en" dir="ltr" class="install-background js">now it is<html lang="en" dir="ltr" class=" js"><body class="maintenance-page db-offline install-page path-">now it is<body class="install-page db-offline path- one-sidebar sidebar-first">Comment #23
wim leersThe facts:
hook_page_attachments()for maintenance/install pages.stylesheetsintolibrariesand uses a library dependency.hook_page_attachments()used to be namedhook_page_build()and used to allow to do much more than just attaching assets, which is all that you can do with it in HEAD. The full reasoning was documented:Since that is now no longer the case, it is now safe to invoke
hook_page_attachments()for maintenance/install pages.stylesheetswere attached using#type => 'html''s#pre_rendercallback in #2352155: Remove HtmlFragment/HtmlPage, but near the very end of the review cycle for that patch, joelpittet requested that to be moved tosystem_page_attachments()(in #75.3 over there). It made total sense to me (and all reviewers), so we just did that.Hence I think it's best to go with #6 for now. But we need to make
seven/maintenance-pagedeclare a correct dependency still anyway, but that's for another issue then.Comment #24
wim leers#22:
RE: your first 3 points: indeed, see #23.
RE: your last 2 points: no, that's impossible. I also can't reproduce that. I think you might've made a small caching or testing mistake that caused you to find these, because I can't reproduce this on simplytest.me with patches #6 and #14.
Comment #25
alexpottRe #23.1 the patch in #6 does not invoke hook_page_attachments - it just calls system_page_attachments. Should we invoke the hook?
Re #24 my last two points from #22 were comparisons of HEAD and pre #2352155: Remove HtmlFragment/HtmlPage - install-background looks unused so that is a good change. And on IRC @Wim Leers pointed out that this is not a maintenance page so that change is good too. So all that leaves is the
one-sidebar sidebar-first- these don't look right to me.Comment #26
wim leersIt feels fishy to call only
system_page_attachments(), but it's safer, since it doesn't allow other modules to break/complicate the maintenance/install pages. We're cleaning upBareHtmlPageRendereranyway in #2373735: Simplify/clean up BareHtmlPageRenderer, so if we want to clean that up further, that'd be the perfect issue to do so.Comment #27
joelpittet@Wim Leers re #23.5 Does that mean we need to manually invoke these somewhere again for maintenance/install or will the library conversion negate the need to manual invoke those hooks?
FYI didn't write the particular comment (pair reviewing) but still stand by it:)
Also does this comment still ring true with the changes at the end of the review cycle?
Comment #28
alexpottCreated the followups:
Re-uploading patch in #6
Comment #29
joelpittetScreenshot from #28
Thanks @alexpott, it's looking much better and lighter than invoking more than is needed, should we move that assert into a test or was that just temporary to avoid declaring seven styles as a hard dependency in the tests?
Edit: (adding context lines)
Comment #30
alexpottThat assert is in a test - an InstallerTestBase test. The setupLanguage() method interacts with the first page of the installer - which is what we want to test. And we can ensure that we don't break the language character set again :)
Comment #31
hass commented'Seven\'s css is attached.'->"Seven's css is attached."Comment #32
alexpottLife is better without assertion messages since the default ones are more helpful anyway.
Comment #33
joelpittet@alexpott oh I figured there was some reason behind that, looked strange to see asserts inside of a non test*() method. Thanks for explaining.
Comment #34
joelpittetUnless anybody thinks otherwise or testbot explodes, I've manually tested this and it seems like the right approach and includes regression tests. RTBC!
Comment #35
gábor hojtsyVisually look great :)
Comment #36
wim leersLooks good, thanks :)
Comment #38
catchDon't love calls to system module in the installer but we haven't eliminated those from elsewhere in the installer yet, and better this than having things hard coded in _drupal_add_*() on every request.
Committed/pushed to 8.0.x, thanks!
Comment #39
gábor hojtsyThanks all!