Hi,
I realized, that the slider widget is not rendered when multiple bef filter blocks are displayed on a page. The filter blocks coming from different views displays.
As far as I can see, this is due to the fact, that at the beginning of the exposed_form_alter method some defaults are set, one of them is the $bef_js variable:
$bef_js = array(
'datepicker' => FALSE,
'slider' => FALSE,
'settings' => array(),
);
So the slider option is globally set to false, which prevents the slider from being rendered on the client side.
As a quick workaround, the attached patch fixes the problem for me.
The main problem though, is that the javascript settings are not added per view but only once globally, with the effect that the exposed form that is last loaded will overwrite all previous settings.
You should be able to recreate the problem by following these steps:
- Create a view with two page displays.
- Create exposed filters using bef for both of them.
- Add a slider to the first display.
- Add no slider to the second display, but enable the exposed form in block option.
- Enable the exposed filter block in the block configuration.
- Now visit the path defined for the first views display.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | better_exposed_filters-missing-slider-with-multiple-blocks-3.patch | 967 bytes | dobe |
| better_exposed_filters-missing-slider-with-multiple-blocks.patch | 877 bytes | berliner |
Comments
Comment #1
berliner commentedComment #2
mikeker commentedIssue queue cleanup... My apologies for taking so long to address this issue!
I'm not able to reproduce this problem using the latest version of BEF, though I'm not sure I completely understand the situation. Yes, the code defaults to not including any slider Javascript code, but if any filters are set to use sliders turn this setting on.
If you're still seeing this, please reopen with specific steps to reproduce. Thanks!
Comment #3
dobe commentedI am running into this same issue.
The issue exists when there are multiple exposed forms on the same page that are BEF.
So I had for example a page that had 2 views since the default settings exposed 2 bef blocks. The exposed_form_alter function gets ran twice. The first view had the slider the second view did not. So the second view that did not have the slider defaults set the javascript settings to false and never gets set back on.
I am guessing this issue would arise with the datepicker as well. This patch should address that. Basically the same concept as #1 though.
Comment #4
dobe commentedComment #5
dobe commentedThe steps in the main description are perfectly sufficient to reproduce.
Comment #6
nimek commentedThanks for patch.
It works as expected.
Comment #7
jkopel commentedComment #8
jkopel commentedI am able to reproduce this issue, but the patch as supplied does not fix the issue.
With or without the patch I am only able to render one slider (although two datepickers works fine).
Comment #9
neslee canil pintoHi, there will be no more future development for 7.x branch. If you see this issue in 8.x, feel free to file an issue. Closing this as Closed(wont fix).