Closed (fixed)
Project:
ZURB Foundation
Version:
7.x-5.0-rc6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Dec 2016 at 14:03 UTC
Updated:
9 Aug 2017 at 05:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
icicleking commentedThis is a first stab at fixing the issue. I'm running a sort of "dummy" query on the database to see if it's there. There must be a better way, but this does work. I tried wrapping the `entity_get_info()` in a `try` block, but then the theme only loads halfway (no CSS).
Comment #3
icicleking commentedComment #4
icicleking commentedComment #5
icicleking commentedI think this is a better patch, and it does start the theming of the offline maintenance page, however, as stated above, the CSS is not loaded. Which may be a core bug or maybe there's another solution. It may be an issue with core. Digging into core I've found if I
print($schema)on line 3249 in bootstrap.inc, then CSS loads properly. Obviously this is an issue to address elsewhere.Comment #6
icicleking commentedI've created an issue in core https://www.drupal.org/node/2838463#comment-11839244, but this may never be addressed. Perhaps finding another way to integrate with Display Suite is the real solution, rather than call
entity_get_infoinhook_theme_registry_alterComment #7
kshm commentedI've created a patch that checks the database connection using
Database::getConnection()instead while wrapping the remainder of the function's body in the try/catch. This causes thehook_theme_registryto return cleanly when there is no database connection without any calls toentity_get_info()and still load the proper style sheets without any exceptions.Comment #8
kshm commentedComment #9
hongpong commentedThis seems like a good idea, is it possible to get a test that confirms this works? Thank you.
Comment #10
hongpong commentedTested it and it works. Compacted the line breaks and added a comment. Thank you!
Comment #12
hongpong commentedHere is the patch for 7.x-4.x to make it work more gracefully on maintenance mode without a database available.
Comment #14
hongpong commentedThank you for figuring this out!