Problem/Motivation

When creating a carousel display and exporting it to a feature, the resulting view display is broken. The carousel appears unstyled and gets the js error message jCarousel: No width/height set for items. This will cause an infinite loop. Aborting....

The carousel markup lacks a skin class identifier. Looking to the default view, it too lacks the setting designating the selected skin.

Details:

  • Drupal core version 7.8.
  • jCarousel version 7.x-2.x-dev (tested also with 7.x-2.4-alpha3)
  • Views version 7.x-3.x-dev (2011-Sep-26)

Proposed resolution

Successful workarounds include:

  • Edit the display's jcarousel settings, make no changes, and submit. This saves the 'skin' setting and the carousel works.
  • Manually edit the default view, adding to the display a line like the following:
    $handler->display->display_options['style_options']['skin'] = 'default';. Then ensure the view is not overridden and clear the views cache. The carousel works.

Remaining tasks

Determine why this setting is not exported with the rest of the view's settings.

User interface changes

None.

API changes

None.

CommentFileSizeAuthor
#2 handle-unset-plugin-options-1292602-1.patch597 bytesrecrit
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jrb’s picture

I had this same problem, and manually adding the "skin" to the view definition did fix it.

recrit’s picture

Status: Active » Needs review
FileSize
597 bytes

This only happens when the option is set to the "default" skin. Views does not export the option if the value is the same as the default value defined in the plugin's option_definiton().. ie jcarousel_style_plugin::option_definition().

The function template_preprocess_jcarousel_view() uses the storage of the options and not the plugin's resolved options. The attached patch switches the options used.

quicksketch’s picture

Status: Needs review » Reviewed & tested by the community

Excellent patch recrit! Appreciated. I'll review/commit next time I'm working on jCarousel.

quicksketch’s picture

Title: Skin setting not saved in exported view so carousel broken » Carousel does not include all options when displaying code-based default views
Status: Reviewed & tested by the community » Fixed

Tested with success and committed to both both branches. Thanks recrit!

Status: Fixed » Closed (fixed)

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