Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ID handling in IIIF helper methods #2863

Merged
merged 4 commits into from
Jul 17, 2024
Merged

Fix ID handling in IIIF helper methods #2863

merged 4 commits into from
Jul 17, 2024

Conversation

dunn
Copy link
Contributor

@dunn dunn commented Feb 3, 2023

The manifest controller expects the URL to include the exhibit ID and resource ID, but the indexer has been using the ID of the resource's FeaturedImage instead. This doesn't always cause issues, because in many situations the ID of a resource's FeaturedImage and the ID of the resource itself have the same numerical representation. But those numbers can fall out of sync, and manifests will fail to load.

Meanwhile, update the iiif_service#info method to expect the ID of a FeaturedImage rather than a Resource. This brings it in line with the other RIIIFService helper methods and is how Spotlight::CarrierwaveFileResolver behaves.

@dunn dunn force-pushed the iiif-manifest-id branch 2 times, most recently from b2e2a78 to 8be39df Compare April 24, 2023 19:15
@dunn dunn changed the title generate iiif manifest URLs from the resource ID, not the image ID Fix ID handling in IIIF helper methods May 3, 2023
@walkerwier
Copy link

The latter bug (iiif_service#info being passed a Resource id instead of a FeaturedImage id) in particular is causing us some grief at the Digital Library of Georgia. +1 to this fix.

For now we have an initializer that calls Spotlight::Resources::Upload.class_eval do ... to replace to_solr with the fixed version from this PR.

@dunn
Copy link
Contributor Author

dunn commented Apr 3, 2024

bumping this again

@jcoyne
Copy link
Member

jcoyne commented May 22, 2024

Is it possible to add a test that can demonstrate how this fix works to fix the problem?

@dunn
Copy link
Contributor Author

dunn commented May 28, 2024

@jcoyne we should be able to have a test that sets up a Resource and FeaturedImage with mismatched IDs, and runs through the logic, but I haven't been involved in Spotlight development for a while (not since I opened this PR over a year ago) and I don't currently have the time to do so.

dunn and others added 4 commits July 17, 2024 09:23
The manifest controller expects the URL to include the exhibit ID and resource
ID, but the indexer has been using the ID of the resource's FeaturedImage
instead.  This doesn't always cause issues, because in many situations the ID of
a resource's FeaturedImage and the ID of the resource itself have the same
numerical representation.  But those numbers can fall out of sync, and manifests
will fail to load.
This matches the behavior of the other helpers and of CarrierwaveFileResolver
@jcoyne jcoyne merged commit ab34085 into main Jul 17, 2024
8 checks passed
@jcoyne jcoyne deleted the iiif-manifest-id branch July 17, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants