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.
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
Comment #1
Brauny CreditAttribution: Brauny commentedUpdate 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.
Comment #2
Brauny CreditAttribution: Brauny commentedProblem fixed. Lesson learned. Don't create new regions in the Fusion theme.