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.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | handle-unset-plugin-options-1292602-1.patch | 597 bytes | recrit |
Comments
Comment #1
jrbI had this same problem, and manually adding the "skin" to the view definition did fix it.
Comment #2
recrit CreditAttribution: recrit commentedThis 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.
Comment #3
quicksketchExcellent patch recrit! Appreciated. I'll review/commit next time I'm working on jCarousel.
Comment #4
quicksketchTested with success and committed to both both branches. Thanks recrit!