When settings is returned via ajax using ajax_command_settings().
The settings is not null and if it doesnt have jcarousel property, it results in js error
settings = settings || Drupal.settings;
"settings.jcarousel is undefined"

here is a patch to fix this

Comments

juampynr’s picture

Status: Active » Reviewed & tested by the community

Verified. Applies cleanly and fixes the issue.

Thanks.

quicksketch’s picture

Status: Reviewed & tested by the community » Needs work

Could we simplify this patch (and the nested logic) just by using:

if (!settings.jcarousel) {
  return;
}

At the top of our behavior? This would help with consistency between the D6 and D7 versions. It'd also make the patch easier for me to review.

chia’s picture

Status: Needs work » Needs review
StatusFileSize
new478 bytes

Simplified the patch by removing nested logic.

myha’s picture

In D6 for me working code is:

if (!settings.jcarousel || !settings.jcarousel.carousels) {
  return;
}
quicksketch’s picture

Status: Needs review » Fixed

Thanks guys. I used chia's patch and amended it with myha's suggestion. Committed to 2.x branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.