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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Fix ID handling in IIIF helper methods #2863

wants to merge 3 commits into from

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 added 2 commits April 3, 2024 13:34
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
@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.

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.

None yet

3 participants