Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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')
Comment | File | Size | Author |
---|---|---|---|
#3 | better_exposed_filters-slider_options-1961486-3.patch | 724 bytes | maximpodorov |
Comments
Comment #1
mikeker CreditAttribution: mikeker commentedApologies 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.
Comment #2
AaronBaumanI have moved away from using sliders, but will re-open if I implement them again.
Comment #3
maximpodorov CreditAttribution: maximpodorov commentedJavaScript 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.
Comment #4
maximpodorov CreditAttribution: maximpodorov commented@mikeker
Please apply this simple fix.
Comment #5
mikeker CreditAttribution: mikeker commentedI'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 usecontext
is wrapped inonce()
. 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!
Comment #6
maximpodorov CreditAttribution: maximpodorov commentedI 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.
Comment #7
maximpodorov CreditAttribution: maximpodorov commentedThe 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.
Comment #8
mikeker CreditAttribution: mikeker commented@maximpodorov: Again, I need an export of the view in question.
Drupal.settings.better_exposed_filters.slider_options
should always be defined ifDrupal.settings.better_exposed_filters.slider
is TRUE. Committing this patch only hides the underlying problem: that slider is TRUE while slider_options is undefined.Comment #9
pdesai CreditAttribution: pdesai commentedI am getting this error below when you try to use the Better Exposed Filters with fields that use relationships.
Comment #10
TravisJohnston CreditAttribution: TravisJohnston commentedHey 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.
Comment #11
ben_chad CreditAttribution: ben_chad commentedSubscribing -- and I'm having the exact same issues as #10.
Comment #12
maximpodorov CreditAttribution: maximpodorov commented@mikeker, is this problem fixed by the fix in #1841452: Javascript error: Uncaught TypeError: Object #<Object> has no method 'datepicker' ?
Comment #13
mikeker CreditAttribution: 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. 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!