Kris-B / nanoGALLERY

image gallery simplified - jQuery plugin. Touch enabled, responsive, justified/cascading/grid layout and it supports pulling in Flickr, Google Photos and self hosted images.
https://nanogallery2.nanostudio.org/
436 stars 100 forks source link

Flickr albumSorting bug #22

Closed markkohdev closed 10 years ago

markkohdev commented 10 years ago

When supplied with an albumSorting option when using Flickr, the plugin breaks with the error: "Uncaught TypeError: Cannot set property 'photo' of undefined "

This is caused by an unknown property set in jquery.nanogallery.js:1469-1475:

if( typeof g_options.albumSorting !== 'undefined' ) { //GI
  if( g_options.albumSorting == 'random' ) {
    data.photoset.photo=shuffle(data.photosets.photoset);
  }else if( g_options.albumSorting == 'reversed' ) {
    data.photoset.photo=data.photosets.photoset.reverse();
  }
}

Which should be:

if( typeof g_options.albumSorting !== 'undefined' ) { //GI
  if( g_options.albumSorting == 'random' ) {
    data.photosets.photoset=shuffle(data.photosets.photoset);
  }else if( g_options.albumSorting == 'reversed' ) {
     data.photosets.photoset=data.photosets.photoset.reverse();
  }
}

I hope this helps!

Kris-B commented 10 years ago

Thanks for the advice. It will be fixed in release 4.4.1

Kris-B commented 10 years ago

v4.4.1 has been released.