After updating to latest dev, configuring an exposed filter to be a slider, and saving the view, i'm getting javascript errors that prevent me from editing views filters via the UI.

Here is the error:
TypeError: 'undefined' is not an object (evaluating 'Drupal.settings.better_exposed_filters.datepicker_options.dateformat')

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeker’s picture

Status: Active » Postponed (maintainer needs more info)

Apologies for the delay in replying to this issue. Let me know if you are still seeing the problem. In general, editing and resaving the view after upgrading the BEF code will fix these sorts of issues.

Please reopen with an export of the view in question if you are still seeing this issue.

Thanks.

AaronBauman’s picture

I have moved away from using sliders, but will re-open if I implement them again.

maximpodorov’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Needs review
FileSize
724 bytes

JavaScript code passes undefined value to $.each() - this makes jQuery mad. The patch fixes this.
By the way, behaviors don't use 'context' arguments at all - this may lead to very annoying bugs.

maximpodorov’s picture

@mikeker
Please apply this simple fix.

mikeker’s picture

Status: Needs review » Closed (cannot reproduce)

I'm unable to reproduce the original error. If you have a view that throws a JS error, please attach it or give specific instructions to recreate it.

re: behaviors not using context: It's true that BEF's JS code could use some updating. For the most part the code that doesn't use context is wrapped in once(). I can't think of any situations where that would fire on elements that you didn't want it to. If you have a use-case, please open it as a separate issue.

Thanks!

maximpodorov’s picture

I had a problem when Drupal.settings.better_exposed_filters.slider_options was undefined, and $.each() broke the JS execution. The patch solved this for me.

maximpodorov’s picture

Status: Closed (cannot reproduce) » Needs review

The bug still exists in the latest dev. It can be triggered by the following actions:
- create a rule
- try to add new action to the rule: 'Load a list of entity ids from a VBO View.'
The result is javascript error. Even the list of views can't be shown.

The patch solves this problem completely.

mikeker’s picture

Status: Needs review » Postponed (maintainer needs more info)

@maximpodorov: Again, I need an export of the view in question. Drupal.settings.better_exposed_filters.slider_options should always be defined if Drupal.settings.better_exposed_filters.slider is TRUE. Committing this patch only hides the underlying problem: that slider is TRUE while slider_options is undefined.

pdesai’s picture

I am getting this error below when you try to use the Better Exposed Filters with fields that use relationships.

TravisJohnston’s picture

Hey maximpodorov,

Having the exact same issue, though the patch doesn't solve it for me. I am still getting "dateformat undefined" in my console log.

Mikeker,

Does the actual view matter? Or are you referring to the Rule? I am able to replicate it by creating a random rule component, no parameters added, then clicking on Add Action and trying to select the option to 'Load a list of entity ids from a VBO View'. The toggle runs then fails, resulting in the above error in my console log.

ben_chad’s picture

Subscribing -- and I'm having the exact same issues as #10.

maximpodorov’s picture

mikeker’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Issue 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. I believe (hope? :) that @maximpodorov is correct in #12. As such I'm closing this as fixed. If you are still seeing this error, please reopen with specific steps to reproduce.

Thanks!