Closed (fixed)
Project:
jCarousel
Version:
6.x-2.3
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Feb 2011 at 22:57 UTC
Updated:
20 Apr 2011 at 19:11 UTC
Jump to comment: Most recent file
installing this new version produce al lot of options[optionKey].split is not a function errors, this cause other javascripts screwing-up, like colorbox combined on jcarousel in views.
I had to return to the previous version and all went to its place.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | jcarousel_behavior_fix.patch | 1.25 KB | quicksketch |
| #15 | jcarousel-conflict-with-other-javascript-1058028-15.patch | 1.42 KB | taran2l |
| #13 | jCarousel-plugin-js-fixes.diff | 2.35 KB | dzaus |
| #7 | jcarousel_patch2.patch | 742 bytes | taran2l |
Comments
Comment #1
quicksketchHm interesting. What options are you passing into jCarousel? I see how this could be a problem when passing in options that are not strings.
Comment #2
d.sibaud commentedI attach herewith the exported view, so you can see how jcarousel is configured:
Comment #3
quicksketchHuh, okay I was expecting that you had used jcarousel_add() directly. I'll try out a view with your configuration and see if I can reproduce.
Comment #4
alanom commentedI'm also encountering this problem (jCarousel 6.x-2.3). From Firebug:
options[optionKey].split is not a function
[Break On This Error] var callbackParents = options[optionKey].split('.');
jcarousel.js?7 (line 17)
This happens after a completely unrelated view block elsewhere on the page with an exposed filter completes the process of loading new content after the filter is used. The new content is loaded, then the error occurs.
Hopefully that'll help with replicating the problem. It's an ordinary exposed filter using node: nid.
Here's the settings of the carousel it's clashing with, copied from view source.
Like the other guy this is a normal Views view, set up using Views UI set to jCarousel display.
Comment #5
echoz commentedGlad to find I'm not the only one.
The code added in #1009142: jCarousel callback options do not work #8 patch gives me the following error for jcarousel.js:
"TypeError: Result of expression 'options[optionKey].split' [undefined] is not a function."
while using another module on the page, when it uses thickbox. This only occurs when I have AJAX set to yes in my carousel view. I am not using jcarousel_add().
Commenting out the code added in this patch makes the error go away, and allows the thickbox implementation to work, which is broken with this code added.
Comment #6
alanom commentedPerfect! Thanks! Drupal community == awesome.
Comment #7
taran2lHere's a patch to fix a problem.
Comment #8
echoz commented#7 patch fixes my issue reported in #5. Nice work Taran2l.
I repeat that I am not using jcarousel_add(), I just am using ajax in my carousel view and another module using thickbox failed to function, therefore I think someone who is using jcarousel_add() should also text this.
Comment #9
dgsiegel commentedi can confirm too that patch #7 fixes the issue i had with jcarousel and colorbox. i tried both with and without ajax in my view.
Comment #10
Quaranta commentedThis patch (#7) also fixed the issue with hierarchical select, nice work!I spoke too soon, the problem is still there
Comment #11
joostvdl commentedThe problem also occurs in 7.x-2.3-alpha2
I created a D7 patch for this problem on: #1053522: jcarousel breaks colorbox
Comment #12
echoz commentedComment #13
dzaus commentedI ran into similar problems, and had come up with a different fix than #7 (but I like yours better). I noticed that after fixing the first javascript error, I was getting a different script error when I had another regular view (on the same page) paging with ajax.
The addition in the beginning of the attached patch (which includes #7 and some additional changes for allowing external controls) fixed my issues. When I stepped through the script in Firebug, I noticed that the behaviors.jcarousel function, which I assume binds the behaviors and sets up everything, gets run once on page load (hence
context.noneName != '#document'), and again when the second view's ajax fires, at which point the context becomes the viewdiv.content.The conditional at the beginning prevents the behaviors from being reperformed/initialized (?) on the wrong element, I think.
Comment #14
jiri.motejlek commentedProblem seems to be solved by #13
Comment #15
taran2lHi all,
The source of the problem is in not entirely proper use of Drupal.behaviors.
Each core behavior adds behaviorname-processed class to DOM elements is being processed by particular behavior. Example(collapse.js, responsible for collapsing fieldsets):
The code above prevents multiple JS code execution on the same DOM element. jCarousel module doesn't make this check at all.
Patch attached to fix this problem, hope it can close this issue. Please test and review.
Comment #16
pieterdcPatch from #7 works for me.
(Emfield youtube video didn't get displayed in Colorbox if within a Jcarousel.)
Comment #17
quicksketchThanks Taran2l, your patch in #15 looks stellar. I cleaned it up slightly for coding standards and removed some extra cruft that I had in place. I've committed this patch to both branches.
Comment #18
quicksketchCleaning up title for accuracy.