collectiveaccess / pawtucket2

Pawtucket Improved
GNU General Public License v3.0
85 stars 76 forks source link

Detail Carousel Doesn't Work With > 2 Representations #38

Closed miqrogroove closed 2 years ago

miqrogroove commented 2 years ago

After more testing, it looks like the carousel on the object Detail page is initialized incorrectly and as a result will only work when there are exactly 1 or 2 representations attached to an object. Any more than that and it is necessary to click through all of the slides before the carousel is properly initialized.

Note 1: The TileViewer is not affected by this bug. After clicking to enlarge, the little links at the bottom of the viewer will advance through the images as expected.

Note 2: The Gallery carousel is not affected by this bug. That one works as expected.

Note 3: Much of the carousel code lives in https://github.com/collectiveaccess/pawtucket2/blob/master/themes/default/views/bundles/representation_viewer_html.php

Note 4: The carousel is invoked by https://github.com/collectiveaccess/pawtucket2/blob/855d52732ce55ec8498b5ee8a22d921d0ee8584b/themes/default/views/Details/ca_objects_default_html.php#L49

collectiveaccess commented 2 years ago

This one with 6 images (note it will revert to a single image tonight when the demo resets) works fine for me. https://demo.collectiveaccess.org/pawtucket/Detail/objects/34

miqrogroove commented 2 years ago

That link doesn't work for me. Try these steps:

  1. Click the link
  2. Click one of the 3rd through 6th thumbnails.
  3. Click any previous thumbnail (except the 1st).

Expected result:

The selected image should load.

Actual result:

None of the previous images will load in any order unless the user returns to the 1st image and clicks the thumbnails in exactly the displayed order.

Workaround:

Reduce the number of representations to 2 or less.

collectiveaccess commented 2 years ago

I can get this intermittently to happen in Chrome. It does not happen in Safari. I'll look into why. Thanks for reporting.

miqrogroove commented 2 years ago

I'm running v1.7.16.

With some more experimentation, it looks like there's an additional problem after the carousel is initialized. When clicking the left and right arrows on the Details page, rather than the thumbnails or the viewer, the image order is always wrong. It shows the "primary" image by default, and then subsequent clicks cause the images to display in the order originally uploaded (numerical ID order?) and never in the order listed nor the order of the thumbnails, unless they are still in the original uploaded order as well.

miqrogroove commented 1 year ago

I just noticed there is a minor lingering issue with the arrows and thumbnails. I will test more and open a new issue when I can pinpoint it better.