jQuery 1.3.2
jQuery UI 1.7.3
jQuery Cycle 2.99
Drupal 6.22
Views 6.x-3.x-dev
Views Slideshow 6.x-3.x-dev

I am getting the following error "Drupal.settings.viewsSlideshowPager[options.slideshowID].top is undefined".

the view is embedded on a node using

"function template_preprocess_node(&$vars, $hook) {
// Render the view.
$vars['department_ads_view'] = views_embed_view('department_ads', 'block_1');

//Reload the javascript into the scripts.
$vars['scripts'] = drupal_get_js();
}"

and then printed on a custom page.tpl like so

"

print $department_ads_view;

"

I have also tried the same on template_preprocess_page, and also using views embed directly on the node.tpl, all with the same results.

How can I resolve this problem

here is the Drupal.settings javascript from the src

"

"

Comments

valderson’s picture

StatusFileSize
new7 KB

attached Drupal.settings javascript

valderson’s picture

Category: bug » support

can anybody give a tip and how to resolve this?

valderson’s picture

downgrading to 6.x-3.0-beta1 has made the errors go away

Roulion’s picture

I also encounter the issue
settings.targetId = '#' + $(fullId + " :first").attr('id');

the strange pointe is that when i look at my home page (http://www.afterfoot.fr) as an anonymous, i have the error (the page is served by boost). When i'm logged in, the error desappears

manos_ws’s picture

Exactly the same problem.
And its not boost related. Only appears for anonymous users.

Views 6.x-3.x-dev (2011-Jul-13)
Views Slideshow 6.x-3.x-dev (2011-Jun-27)

viewsslideshow.js
Line 142
Drupal.settings.viewsSlideshowPager is undefined

manos_ws’s picture

For the comment I made above I would like to say that now I have the same problem for logged in admin user, not just anonymous

Thanks

redndahead’s picture

Status: Active » Postponed (maintainer needs more info)

Using the latest of each module with all caching turned on I can't reproduce this issue. Can you check with the latest version of everything?

ayntree’s picture

I'm also getting this syntax error..

alioso’s picture

I am getting this on Drupal 7 as well. Tried everything to make it go away with no success

protoplasm’s picture

It's an error that's triggered on line 1283 of the jquery javascript library 1.3.2 and you won't notice it unless firefox's error console is enabled. Then the entire page freezes in firefox and you can't not notice it. Here's the offended line:

if (typeof Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type].pause == 'function')

I've tried the easy work arounds without luck...except one-->

If you unclick the pause on hover button, the error is not triggered. It's only triggered when the mouse hovers...at least on my site.

but... Once that's fixed, another error at 1382 is tripped even with the hover unclicked:

if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].transitionBegin == 'function') {
Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].transitionBegin(options);

so if you then click the top pager checkbox, this error goes away and then it triggers yet another error.

So it would appear that the errors are related to the state of the controls?

(I'm getting these errors in views slideshow 3.0. )

Addendum: I've had to revert to vs 2.3 to get functionality without throwing javascript errors.

oliver huynh’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Component: Cycle » Code
Category: support » bug
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.54 KB

Patch is attached. This JS error is simple to fix.

eric.chenchao’s picture

Thanks @oliverhuynh. Still got errors caused by typeof Drupal.settings.viewsSlideshowControls is undefined in FF

Need to change

      if (typeof Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type].play == 'function') {
        Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type].play(options);
      }

to

      if (typeof Drupal.settings.viewsSlideshowControls != "undefined" && typeof Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type].play == 'function') {
        Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].top.type].play(options);
      }

and

      if (typeof Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type].play == 'function') {
        Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type].play(options);
      }

to

      if (typeof Drupal.settings.viewsSlideshowControls != "undefined" && typeof Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type].play == 'function') {
        Drupal[Drupal.settings.viewsSlideshowControls[options.slideshowID].bottom.type].play(options);
      }
mark@redhorseinteractive.com’s picture

Thanks. I am having the same problem but this code change still did not resolve this error. Any other ideas. Do you think it is a version of the code that is being used?
Obviously Views Slideshow works for some people?

ianabc’s picture

I'm having the same problem with the following setup

drupal: 7.15
views: 7.x-3.3
views_slideshow: 7.x-3.0
jquery: 1.4.4
jquery.ui: 1.8.7
jquery.cycle: 2.9999.5

If I have firebug running and I reload the page with the slideshow on it the page load hangs with the following error in the firebug console:
Drupal.settings.viewsSlideshowPager[options.slideshowID].top is undefined

The piece of code throwing the error is:

if (typeof Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type != "undefined" && typeof Drupal[Drupal.settings.viewsSlideshowPager[options.slideshowID].top.type].transitionBegin == 'function') {

If I do something similar to comment 12, then clear all caches, then I can avoid the error (patch attached). no improvement

jwjoshuawalker’s picture

Turning off jQuery Update module fixed this for me.

jwjoshuawalker’s picture

Woops, I'm sorry no it didn't. Chrome dev & Firebug just weren't reporting it for the first few times. It did make some other things work more 'properly' though.

anybody’s picture

Same problem here. This is quite critical, because it leads to other JS disfunctionality on the page. The issue is already open for too long.

Adding the following statement fixes the issue firstofall.
Drupal.settings.viewsSlideshowPager != undefined && ...

webatelier’s picture

i applied several (if not all) patches from this thread and think i solved it for now
to avoid others having to re-read this thread 5 times,
full patched views_slideshow.js file in attach
hope it works for others too ? please review
edit : file in post below

webatelier’s picture

StatusFileSize
new19.5 KB

2nd try to attach file

anybody’s picture

Status: Needs review » Reviewed & tested by the community

@#19
Will this patch be integrated into the next release? Could you perhaps contact the maintainer?

I'll set this as reviewed & tested by community.

webatelier’s picture

i think this needs more reviewing from professional coders (=not me !)
I only assembled the different bits of code and found (i think) a solution by trial and error ...

anybody’s picture

Status: Reviewed & tested by the community » Needs review
MVRider’s picture

Version: 7.x-3.x-dev » 6.x-3.0

I have the same issue on 3 production sites. Has anyone else found a solution that works? Seems like many users have seen this issue.

Nicholas Cook’s picture

Version: 6.x-3.0 » 7.x-3.0
StatusFileSize
new21.52 KB

I was also getting this error...I've modified the view_slideshow.js even more and I'm not getting the errors in FF.

jchmura’s picture

I'm not sure if this will help anybody, but I managed to solve this problem with a slight tweak to my views settings. In the "Pager" options, I changed it from "Display all items" to "Display a specified number of items". Under the settings/options for "Items to Display", I set it to 0 (for no limit). This eliminated the error for me, and my site is running more smoothly now as a result. It appears that this error may be related to a programmatic ambiguity of "all items" when using that options? I hope that this helps somebody else.

fboulanger’s picture

jchmura, I'm trying your "Display a specified number of items" to 0 solution, but I always got the same problem...
the webatelier patch doesn't work too.

Maybe a solution that work for the moment :
I activate the 'paginations' and 'controls' (top and bottom widgets) in the widgets options of the slideshow parameters in views. then I hide this with css.

hope this help until a debug will be found.

ivanhelguera’s picture

I can confirm the issue. It also makes the whole site horribly slow when FBug is on - which makes things really difficult. Tried to upgrade to a dev version, limiting the items, and showing pager - nothing changed. Drupal 7.22, Views Slideshow 7-3.0

wangqizhong’s picture

Status: Needs review » Fixed

Thanks a lot to valderson, Oliver Huynh, cityreader, ianabc, webatelier, Nicholas and everyone else for the great work on the patches, testing, reviews and reporting.

It's more time this got committed and I went ahead and had this rolled at:

7.x-3.x: 1333ea2

6.x-3.x: 12cadcf

Marking this as fixed.

Please let me know if you would have any other questions, comments, issues or concerns on any of these changes, I would be glad to provide more information.
Thanks again to everyone for the help and great work on this issue.

Cheers!

ivanhelguera’s picture

Does that mean that using the latest dev version will solve the issue?
(and a great thank you to all people involved !)

wangqizhong’s picture

Yep, Thanks for your support, if you have any questions please feedback.

Status: Fixed » Closed (fixed)

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