Discovered a minor bug with an easy fix. I have a sub-theme based off of Bootstrap, and in it I want to enable the "bootstrap_fluid_container" setting by default. So I put the following in my theme's .info file:
; Container
; --------------
settings[bootstrap_fluid_container] = 1
On a new install, this does not work. If I go to the theme settings form, however, the fluid container option IS CHECKED. But it does not take affect until after I click save on the settings form.
This is happening because that setting is being checked with a triple-equals operator (===) in page.vars.php (in two places):
if(bootstrap_setting('fluid_container') === 1) {
You would think that would work, but when the setting is loaded from the default theme settings, it's a string not an integer, so that condition fails.
Therefore, my proposed solution is to change it to a double-equals operator (==). Patch on the way!
Comment | File | Size | Author |
---|---|---|---|
#2 | bootstrap_fluid_container_default-2556603-1.patch | 904 bytes | m.stenta |
Comments
Comment #2
m.stentaPatch attached.
Comment #4
markhalliwellActually just ran into this too. Thanks for the patch @m.stenta!
@neardark, so I tried applying this to 8.x, but it turns out that the work you did in #2474771: Clean up Bootstrap Settings code reverted the container-fluid stuff from #2260199: Add toggle for .container or .container-fluid in Grid settings: http://cgit.drupalcode.org/bootstrap/diff/templates/system/page.vars.php...
Assigning to you.
Comment #5
markhalliwell