I am running Drupal core 7.50 with Views 7.x-3.14, and Views Slideshow 7.x-3.1

The Views Slideshow Jcarousel pager can be configured with no problems, but when the HTML is rendered, the views_slideshow_jcarousel_pager added by the module's template gets modified to views-slideshow-jcarousel-pager (underscores replaced with hyphens). This means that the javascript which is using a selector based on the class with underscores does not match any elements, and so the JCarousel is never actually applied. This ends up with just a plain list of non-functional page entries displayed in the view, instead of an actual pager.

This is almost certainly related to the use of drupal_clean_css_identifier, in (includes/common.inc in core), which is filtering underscores to hyphens despite the comment indicating that underscores are perfectly valid. There are outstanding views issues related to this: Allow double underscores to pass through drupal_clean_css_identifier as per new CSS standards, Allow underscores in CSS classes. See also this thread on drupal.stackexchange.org

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LittleRedHen created an issue. See original summary.

LittleRedHen’s picture

This patch works around the problem by using *both* variations of the class in the jQuery selector which applies the JCarousel behaviour. This should be effective both now while the underlying problem exists, while continuing to work when the underlying problem gets corrected.

It also ensures that the click behaviour is applied to pager items before the JCarousel behaviour is applied to the pager's container. This is needed because applying jCarousel to the container *removes* the classes on the contained items, which means that if JCarousel initialises fast enough (such as when the script is being debugged...) the click-selector no longer works. Changing the order in which these behaviours are applied means that that particular problem cannot occur.

DamienMcKenna’s picture

Status: Active » Needs review
alex_gred’s picture

Patch #2 woks fine for me. Thanks.