I created a gallery with 9 items. When I see the first item the pager it's ok, but when I move to another item, sometimes the pager it's incomplete.
I first seen this here.

CommentFileSizeAuthor
Clipboard-3.jpg50.39 KBidflorin
Clipboard-2.jpg22.5 KBidflorin
Clipboard-1.jpg26.68 KBidflorin
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

infernalshade’s picture

I have the same Problem... any solution?

I've set my Pager to show 7 Thumbnails as Pager-Icons. If i have 1-7 Images in my Gallery everything works fine.

But i have a Gallery with 12 images. The first one is shown correctly, but if i switch to the second one (it doesnt matter if i use "next" or click on the item directly) the pager only shows Image 11 and 12 - prev and next Buttons are working fine at this point, only the images arent shown! If i press "next" then, to show image 3 , the Pager show only image 12. Then, after pressing "next" (to switch to image 4), everything works fine again!

Thx and greetz,
infernalshade

infernalshade’s picture

I've found the Problem for this behavior:

In gallery_assist.module you can find following part on line 3837:

if ($my_page + $my_middle - $my_odd < $my_total) {
$mysmall = array_slice($links, $my_page - $my_middle, $my_quantity, TRUE);
}
else {
$mysmall = array_slice($links, $my_total - $my_quantity, $my_quantity, TRUE);
}

Change these lines to this:

//if ($my_page + $my_middle - $my_odd < $my_total) {
//$mysmall = array_slice($links, $my_page - $my_middle, $my_quantity, TRUE);
//}
//else {
$mysmall = array_slice($links, $my_total - $my_quantity, $my_quantity, TRUE);
//}

This "Workaround" works fine for me, the only bad thing is, the currently viewed pager item is always on the left side, not in the middle...

OmarQot’s picture

thanks for the note, but here is the solution that fixes the problem

In gallery_assist.module you can find following part on line 3837:

if ($my_page + $my_middle - $my_odd < $my_total) {
$mysmall = array_slice($links, $my_page - $my_middle, $my_quantity, TRUE);
}
else {
$mysmall = array_slice($links, $my_total - $my_quantity, $my_quantity, TRUE);
}

Replace it with and should be be working fine

      if ($my_page + $my_middle - $my_odd < $my_total) {
      	if($my_page <  $my_middle){
      		$mysmall = array_slice($links, 0, $my_quantity, TRUE);
      	}
      	else{
        	$mysmall = array_slice($links, $my_page - $my_middle, $my_quantity, TRUE);
        }        
      }
      else {
        $mysmall = array_slice($links, $my_total - $my_quantity, $my_quantity, TRUE);
      }