diff --git a/app/components/spotlight/solr_document_legacy_embed_component.html.erb b/app/components/spotlight/solr_document_legacy_embed_component.html.erb
new file mode 100644
index 000000000..c428f9208
--- /dev/null
+++ b/app/components/spotlight/solr_document_legacy_embed_component.html.erb
@@ -0,0 +1,11 @@
+<% if body.present? %>
+ <%= body %>
+<% elsif partials? %>
+ <% partials.each do |partial| %>
+ <%= partial %>
+ <% end %>
+<% elsif embed? %>
+ <%= embed %>
+<% elsif thumbnail? %>
+ <%= thumbnail %>
+<% end %>
diff --git a/app/components/spotlight/solr_document_legacy_embed_component.rb b/app/components/spotlight/solr_document_legacy_embed_component.rb
new file mode 100644
index 000000000..8855e09aa
--- /dev/null
+++ b/app/components/spotlight/solr_document_legacy_embed_component.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+# Render an document suitable for embedding on a feature page.
+module Spotlight
+ class SolrDocumentLegacyEmbedComponent < Blacklight::DocumentComponent
+ end
+end
diff --git a/app/models/spotlight/blacklight_configuration.rb b/app/models/spotlight/blacklight_configuration.rb
index 38a4eb85e..705fc52c2 100644
--- a/app/models/spotlight/blacklight_configuration.rb
+++ b/app/models/spotlight/blacklight_configuration.rb
@@ -122,7 +122,10 @@ def blacklight_config
config.view.embed!
# This is blacklight-gallery's openseadragon partial
- config.view.embed.partials ||= ['openseadragon']
+ unless config.view.embed.document_component
+ config.view.embed.partials ||= ['openseadragon']
+ config.view.embed.document_component = Spotlight::SolrDocumentLegacyEmbedComponent
+ end
config.view.embed.if = false
# blacklight-gallery requires tile_source_field
diff --git a/app/views/spotlight/sir_trevor/blocks/_embedded_document.html.erb b/app/views/spotlight/sir_trevor/blocks/_embedded_document.html.erb
new file mode 100644
index 000000000..cb18e6944
--- /dev/null
+++ b/app/views/spotlight/sir_trevor/blocks/_embedded_document.html.erb
@@ -0,0 +1,8 @@
+
+ <% view_config = blacklight_config.view_config(:embed) %>
+ <%= render (view_config.document_component || Spotlight::SolrDocumentLegacyEmbedComponent).new((Blacklight.version > '8.0' ? :document : :presenter) => document_presenter(document), counter: nil) do |component| %>
+ <% component.with_partial do %>
+ <%= render_document_partials document, view_config.partials, component: component, document_counter: nil, view_config: view_config, block: local_assigns[:block], **(view_config.locals) %>
+ <% end if view_config&.partials&.any? %>
+ <% end %>
+
diff --git a/app/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb b/app/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb
index da87194b8..59ccadbe2 100644
--- a/app/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb
+++ b/app/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb
@@ -14,12 +14,9 @@
<%# Render the openseadragon viewer from blacklight-gallery.
# Settings in blacklight_configuration.rb %>
<% solr_documents_embed_block.each_document do |block_options, document| %>
-
- <% view_config = blacklight_config.view_config(:embed) %>
- <%= render_document_partials document, view_config.partials, (view_config.locals || {}).reverse_merge(block: solr_documents_embed_block, view_config: view_config) %>
-
- <% end %>
-
+ <%= render '/spotlight/sir_trevor/blocks/embedded_document', document: document, block: solr_documents_embed_block %>
+ <% end %>
+
<% end %>
diff --git a/blacklight-spotlight.gemspec b/blacklight-spotlight.gemspec
index 8da8e3321..f007eeab1 100644
--- a/blacklight-spotlight.gemspec
+++ b/blacklight-spotlight.gemspec
@@ -23,7 +23,7 @@ these collections.)
s.add_dependency 'activejob-status'
s.add_dependency 'acts-as-taggable-on', '>= 5.0', '< 12'
s.add_dependency 'autoprefixer-rails'
- s.add_dependency 'blacklight', '>= 7.18', '< 9'
+ s.add_dependency 'blacklight', '>= 7.19', '< 9'
s.add_dependency 'blacklight-gallery', '>= 3.0', '< 5'
s.add_dependency 'bootstrap_form', '>= 4.1', '< 6'
s.add_dependency 'breadcrumbs_on_rails', '>= 3.0', '< 5'
diff --git a/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb b/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
index 1da33542b..27f7e7033 100644
--- a/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
+++ b/spec/views/spotlight/sir_trevor/blocks/_solr_documents_embed_block.html.erb_spec.rb
@@ -9,11 +9,19 @@
let(:doc) { blacklight_config.document_model.new(id: 1) }
let(:blacklight_config) do
Blacklight::Configuration.new do |config|
- config.view.embed(partials: %w[a b c], locals: { a: 1 })
+ config.view.embed(
+ document_component: Spotlight::SolrDocumentLegacyEmbedComponent,
+ partials: %w[a b c],
+ locals: { a: 1 }
+ )
end
end
let(:stub_presenter) do
- instance_double(Blacklight::DocumentPresenter, heading: 'blah', thumbnail: thumbnail_presenter)
+ instance_double(Blacklight::DocumentPresenter, document: doc, heading: 'blah',
+ thumbnail: thumbnail_presenter,
+ view_config: blacklight_config.view.embed,
+ field_presenters: [],
+ display_type: nil)
end
let(:thumbnail_presenter) { instance_double(Blacklight::ThumbnailPresenter, exists?: true, thumbnail_tag: 'thumb') }