The slideshows included version of the cycle plugin was being loaded even though I had the jq module and jquery_plugin module with a newer version of the cycle plugin.

The problem stemmed from views_slideshow_thumbnailhover.theme.inc starting on line 54.

  if (module_exists('jq')) {
    if (in_array('cycle', jq_plugins())) {
      $js = jq_add('cycle');
    }
  }

  // Otherwise, we'll add the version included with this module.
  if (!$js) {
    drupal_add_js(drupal_get_path('module', 'views_slideshow') .'/js/jquery.cycle.all.min.js', 'module');
  }

The in_array test would fail and cause the included version to be loaded. The attached patch fixes the issue by changing the above lines to:

  if (module_exists('jq')) {
    $js = jq_add('cycle');
  }

  // Otherwise, we'll add the version included with this module.
  if (!$js) {
    drupal_add_js(drupal_get_path('module', 'views_slideshow') .'/js/jquery.cycle.all.min.js', 'module');
  }

The patch also fixes the jq_add for the hoverIntent plugin also in the file views_slideshow_thumbnailhover.theme.inc.

Comments

redndahead’s picture

Status: Needs review » Needs work

This doesn't seem right. We can't add the cycle plugin if jq just exists because there is no guarantee that the cycle plugin is installed with the module. The idea before is that it checked to make sure the cycle plugin was available before using it. If jq_plugins() isn't working we need to figure out why that is.

redndahead’s picture

Status: Needs work » Needs review
StatusFileSize
new2.45 KB

This patch should take care of it.

recrit’s picture

my thinking was that the _jq_add function calls jq_plugins and then checks the existence of the plugin. So just calling jq_add would result in the same checking as your patch without the 2 calls to jq_plugins. However since jq_plugins caches the plugins theres not really any performance hit with calling it 2 times, so I agree that your patch makes more semantic sense.. especially if jq ever changes the functionality of jq_add.

thanks for the quick response!
the module works great!

redndahead’s picture

Status: Needs review » Fixed

This has been committed.

Status: Fixed » Closed (fixed)

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