ok, so there are multiple ways you can export and use the bootstrap libraries.
- Source (git repo)
- The standard tar
- The tar you get when you customize bootstrap through their LESS UI thing
we want to support all of this shit.
we also want to check to make sure the user has downloaded and set up the library properly.
we also want to check to see that we are loading the JS/CSS properly. i saw that we are doing some sort of preprocess_html add_js/css... i know you can specify the files to be loaded in the libraries_info_hook... any rationale for not doing it this way?
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | kalatheme-better_libraries_integration-1908042-9.patch | 2.3 KB | barraponto |
| #7 | kalatheme-better_libraries_integration-1908042-7.patch | 2.18 KB | barraponto |
Comments
Comment #1
pirog commentedComment #2
pirog commentedloading the correct libraries looks good. now lets focus on if there is a good way to make sure the user has both panopoly_core and the bootstrap libraries actually installed. ideas for how to do that
Comment #3
whastings commentedHere's the update on checking for our theme's dependencies:
As far as we could tell, there's no way for a theme to hook into the process of enabling a theme and prevent itself from being enabled. There's also no way to specify theme dependencies and have Drupal check for them before enabling. So we're moving forward with alerting the user via error messages if they don't have the required dependencies installed.
Comment #4
pirog commentedComment #5
pirog commentedComment #6
pirog commentedComment #7
barrapontoBy defining the bootstrap library later in the process, during
hook_libraries_info_alter, we miss thelibraries_info_defaultscall and whatever goodness it brings. One of them is fulfilling the callbacks array keys, which we manually add right now. But Libraries has recently added a new callback and we're getting warnings because of that...This patch fixes the issue by manually calling
libraries_info_defaults, and fixing an issue that pops up because we were avoiding the default callbacks.Comment #8
barrapontoBut yeah, I'd like to know why we're avoiding
hook_library_info.Comment #9
pirog commentedhook library info can't be called from a theme... at least last time i checked.
Comment #10
pirog commentedlooks like you can now call hook_library_info from a theme in Lib 2.1 which is also now part of Panopoly RC4 so we should change this over in kalatheme as well.
Comment #11
barrapontoYeah, I tried
hook_libraries_infowith latest patch and it worked fine. But the issue is still open, should we work on it first? => #1876124: hook_libraries_info() still doesn't work with themesComment #12
barrapontoHere's a reroll using
hook_libraries_infoComment #13
pirog commentedhmmm yeah i just ran into this problem as well. we definitely dont want to make the switch to hook_libraries_info from hook_libraries_info_alter until hook_libraries_info is stable in both libraries and then in panopoly. that said i think we should proceed as follows...
1. try to get this issue resolved in libraries
2. get a patched or new version of libraries with this fix represented in panopoly
3. make the switch from hook_libraries_info_alter to hook_libraries_info in kalatheme
im trying to preserve version naming with panopoly so presumably this would be targeted for a RC5 release.
in the meantime, panopoly RC4 uses libraries 2.1 so let's stick with hook_libraries_info_alter and get it to play nice with 2.1.
Thoughts?
Comment #14
barrapontoFor Kalatheme RC4, the patch in #7 should be enough. As for the
hook_libraries_infoissue, I closed it as "work as designed". Turns out the issue was that a library declared in a theme can't be relied upon when that theme is not active. But that's no surprise, if the library is meant to be available anywhere (e.g. the administrative theme), it should be declared in a module.So, as far as I can see, Libraries 2.1 supports declaring
hook_libraries_infoin our template.php. Which means we can probably go with patch #10 unless we want to create a Bootstrap module, which would add to Kalatheme's manual dependency checking.Comment #15
defconjuan commentedFor the record, patches #7 & #12 also fix the "Notice: Undefined index: pre-dependencies-load in libraries_invoke() (line 161..." error many people have reported (and continue to seek help on) in the libraries project issues.
Comment #16
pirog commentedi'm going to go with #12 which is going to effectively tie the kalatheme version to the panopoly version. aka after this i don't think kalatheme rc4 is going to work on panopoly rc3 although kalatheme rc3 should still work on panopoly rc4.
i think i'd rather do this and keep the code as uncluttered as possible instead of providing extensive reverse compatibility for all the changes that are going to happen in all the panopoly modules.
Comment #17
pirog commentedComment #18
barraponto