Everything appears to be fine in the configuration interface, yet when I save the block, the banner doesn't rotate. I checked the JS console and am getting this error:

Uncaught TypeError: Cannot read property 'cycle' of undefined

The relevant code is

/*global jQuery: true Drupal: true window: true */

(function ($) {
  Drupal.behaviors.rotatingBanner = {
    attach: function (context) {
      $('.rotating-banner', context).once('jCycleActivated', function () {
        if (!Drupal.settings.rotatingBanners) {
          return;
        }
        var settings = Drupal.settings.rotatingBanners[this.id].cycle;
        if ($.fn.cycle === 'undefined' || $.fn.cycle === undefined) {
          alert(Drupal.t('Jquery Cycle is not installed and is required by the rotating_banner module.\n\nSee the README.txt'));
          return;
        }

        settings.fit = 1;
        settings.cleartypeNoBg = true;

        if(Drupal.settings.rotatingBanners[this.id].controls == 'prev_next') {
          settings.prev = "#" + this.id + " .prev";
          settings.next = "#" + this.id + " .next";
        } else {
          settings.pager = "#" + this.id + " .controls";
        }
				
        $('.rb-slides', this).cycle(settings);
      });
    }
  };
})(jQuery);
;

Comments

Brauny’s picture

Update on this: the error only occurs when the banner block is placed into a new region I just defined called 'rotating banner'. When it's placed in other regions that came default with the fusion theme, it works fine.

Brauny’s picture

Status: Active » Closed (fixed)

Problem fixed. Lesson learned. Don't create new regions in the Fusion theme.