Skip to content

Commit 5ceb29a

Browse files
authored
Fix universal viewer duplicates (#2346)
* Include child file sets for viewer Member ids definition has been modified for IiifPrint so it no longer includes the child works file sets. This patch adjusts for that change. * Update IiifPrint to use main Brings in most recent patches from IiifPrint.
1 parent 6041d6c commit 5ceb29a

File tree

4 files changed

+31
-12
lines changed

4 files changed

+31
-12
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ gem 'hyrax-doi', github: 'samvera-labs/hyrax-doi', branch: 'rails_hyrax_upgrade'
5858
gem 'hyrax-iiif_av', github: 'samvera-labs/hyrax-iiif_av', branch: 'rails_hyrax_upgrade'
5959
gem 'i18n-debug', require: false, group: %i[development test]
6060
gem 'i18n-tasks', group: %i[development test]
61-
gem 'iiif_print'
61+
gem 'iiif_print', github: 'scientist-softserv/iiif_print', branch: 'main'
6262
gem 'jbuilder', '~> 2.5'
6363
gem 'jquery-rails' # Use jquery as the JavaScript library
6464
gem 'openssl', '>= 3.2.0'

Gemfile.lock

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,18 @@ GIT
192192
public_suffix (>= 2)
193193
rack (>= 1.3.6)
194194

195+
GIT
196+
remote: https://github.com/scientist-softserv/iiif_print.git
197+
revision: 02f68fc6d93b44b05d826b29645ef182534a51b5
198+
branch: main
199+
specs:
200+
iiif_print (3.0.1)
201+
blacklight_iiif_search (>= 1.0, < 3.0)
202+
derivative-rodeo (~> 0.5)
203+
hyrax (>= 2.5, < 6)
204+
nokogiri (>= 1.13.2)
205+
rdf-vocab (~> 3.0)
206+
195207
GIT
196208
remote: https://github.com/scientist-softserv/willow_sword.git
197209
revision: 904313fcb669837b363d7095db8e6b7a818d0e21
@@ -330,10 +342,11 @@ GEM
330342
blacklight_advanced_search (7.0.0)
331343
blacklight (~> 7.0)
332344
parslet
333-
blacklight_iiif_search (2.0.0)
345+
blacklight_iiif_search (2.1.0)
334346
blacklight (~> 7.0)
347+
ffi (~> 1.16.3)
335348
iiif-presentation
336-
rails (>= 5.1, < 7)
349+
rails (>= 6, < 7.3)
337350
blacklight_oai_provider (7.0.2)
338351
blacklight (~> 7.0)
339352
oai (~> 1.2)
@@ -752,12 +765,6 @@ GEM
752765
json
753766
iiif_manifest (1.3.1)
754767
activesupport (>= 4)
755-
iiif_print (3.0.1)
756-
blacklight_iiif_search (>= 1.0, < 3.0)
757-
derivative-rodeo (~> 0.5)
758-
hyrax (>= 2.5, < 6)
759-
nokogiri (>= 1.13.2)
760-
rdf-vocab (~> 3.0)
761768
iso-639 (0.3.6)
762769
iso8601 (0.9.1)
763770
jaro_winkler (1.5.6)
@@ -1516,7 +1523,7 @@ DEPENDENCIES
15161523
hyrax-iiif_av!
15171524
i18n-debug
15181525
i18n-tasks
1519-
iiif_print
1526+
iiif_print!
15201527
jbuilder (~> 2.5)
15211528
jquery-rails
15221529
json-canonicalization (= 0.3.1)

app/indexers/concerns/hyku_indexing.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module HykuIndexing
1111
super(*args, **kwargs, &block).tap do |solr_doc|
1212
# rubocop:disable Style/ClassCheck
1313

14-
# Active Fedora refers to objce
14+
# Active Fedora refers to object
1515
# Specs refer to object as @object
1616
# Valkyrie refers to resource
1717
object ||= @object || resource
@@ -20,7 +20,7 @@ module HykuIndexing
2020
solr_doc['bulkrax_identifier_tesim'] = object.bulkrax_identifier if object.respond_to?(:bulkrax_identifier)
2121
solr_doc['account_institution_name_ssim'] = Site.instance.institution_label
2222
solr_doc['valkyrie_bsi'] = object.kind_of?(Valkyrie::Resource)
23-
solr_doc['member_ids_ssim'] = object.member_ids.map(&:id) if object.kind_of?(Valkyrie::Resource)
23+
solr_doc['member_ids_ssim'] = object.member_ids.map(&:to_s)
2424
solr_doc['all_text_tsimv'] = extract_full_text(object)
2525
# rubocop:enable Style/ClassCheck
2626
solr_doc['title_ssi'] = SortTitle.new(object.title.first).alphabetical

app/presenters/hyrax/iiif_manifest_presenter_decorator.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ def search_service
2424
Site.account&.ssl_configured ? url.sub(/\Ahttp:/, 'https:') : url
2525
end
2626

27+
##
28+
# OVERRIDE to find child work's filesets for IiifPrint
29+
# @return [Array<#to_s>]
30+
def member_ids
31+
m = model.is_a?(::SolrDocument) ? model.hydra_model : model.class
32+
m < Hyrax::Resource ? Array.wrap(file_ids) : Hyrax::SolrDocument::OrderedMembers.decorate(model).ordered_member_ids
33+
end
34+
35+
def file_ids
36+
model["descendent_member_ids_ssim"] || model.member_ids
37+
end
38+
2739
##
2840
# @return [String] the URL where the manifest can be found
2941
def manifest_url

0 commit comments

Comments
 (0)