ok, so there are multiple ways you can export and use the bootstrap libraries.

  1. Source (git repo)
  2. The standard tar
  3. 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?

Comments

pirog’s picture

Priority: Normal » Critical
pirog’s picture

loading 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

  1. dont let the user even enable the theme until they have panopoly_core enabled and bootstrap is in the libraries folder (present them instructions if they try to enable beforehand)
  2. let the user enable the theme but bombard them with messages indicating what they need to do (this already kind of happens)
  3. open to other suggestions
whastings’s picture

Here'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.

pirog’s picture

Status: Active » Reviewed & tested by the community
pirog’s picture

Status: Reviewed & tested by the community » Fixed
pirog’s picture

Version: » 7.x-1.x-dev
Status: Fixed » Closed (fixed)
barraponto’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new2.18 KB

By defining the bootstrap library later in the process, during hook_libraries_info_alter, we miss the libraries_info_defaults call 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.

barraponto’s picture

But yeah, I'd like to know why we're avoiding hook_library_info.

pirog’s picture

hook library info can't be called from a theme... at least last time i checked.

pirog’s picture

looks 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.

barraponto’s picture

Yeah, I tried hook_libraries_info with 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 themes

barraponto’s picture

Here's a reroll using hook_libraries_info

pirog’s picture

hmmm 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?

barraponto’s picture

For Kalatheme RC4, the patch in #7 should be enough. As for the hook_libraries_info issue, 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_info in 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.

defconjuan’s picture

For 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.

pirog’s picture

i'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.

pirog’s picture

Status: Needs review » Closed (fixed)
barraponto’s picture

Status: Closed (fixed) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 801fe00 on 7.x-1.x, 7.x-3.x, layout_builder authored by barraponto, committed by pirog:
    Issue #1908042 by pirog: Better Libraries integration
    

  • Commit 801fe00 on 7.x-1.x, 7.x-3.x, layout_builder, fake-new-branch authored by barraponto, committed by pirog:
    Issue #1908042 by pirog: Better Libraries integration
    

  • Commit 801fe00 on 7.x-1.x, 7.x-3.x, layout_builder, 7.x-4.x authored by barraponto, committed by pirog:
    Issue #1908042 by pirog: Better Libraries integration
    

  • Commit 801fe00 on 7.x-1.x, 7.x-3.x, layout_builder, 7.x-4.x authored by barraponto, committed by pirog:
    Issue #1908042 by pirog: Better Libraries integration
    

  • Commit 801fe00 on 7.x-1.x, 7.x-3.x, layout_builder, 7.x-4.x, icons, kalatheme-dropdown-class authored by barraponto, committed by pirog:
    Issue #1908042 by pirog: Better Libraries integration
    
  • Commit 801fe00 on 7.x-1.x, 7.x-3.x, layout_builder, 7.x-4.x, icons, kalatheme-dropdown-class authored by barraponto, committed by pirog:
    Issue #1908042 by pirog: Better Libraries integration
    

  • Commit 801fe00 on 7.x-1.x, 7.x-3.x, layout_builder, 7.x-4.x, icons, kalatheme-dropdown-class, master authored by barraponto, committed by pirog:
    Issue #1908042 by pirog: Better Libraries integration
    

  • Commit 801fe00 on 7.x-1.x, 7.x-3.x, layout_builder, 7.x-4.x, kalatheme-dropdown-class, master, casperjs, views-plugin-simplification authored by barraponto, committed by pirog:
    Issue #1908042 by pirog: Better Libraries integration
    
  • Commit 801fe00 on 7.x-1.x, 7.x-3.x, layout_builder, 7.x-4.x, kalatheme-dropdown-class, master, casperjs, views-plugin-simplification authored by barraponto, committed by pirog:
    Issue #1908042 by pirog: Better Libraries integration