From 52625bb712c6648ceb7a8ae71974bfc0c162b14f Mon Sep 17 00:00:00 2001 From: Sean Aery Date: Wed, 12 Nov 2025 15:10:50 -0500 Subject: [PATCH 1/5] test on Blacklight v9.0.0.beta8 --- .github/workflows/ruby.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 6aedabf4c..67c354e47 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -22,8 +22,8 @@ jobs: - ruby: "3.2" rails_version: 7.1.5.1 - ruby: "3.4" - rails_version: "8.0.1" - blacklight_version: 9.0.0.beta1 + rails_version: "8.0.4" + blacklight_version: 9.0.0.beta8 additional_name: "/ Blacklight 9" env: RAILS_VERSION: ${{ matrix.rails_version }} From f4766eefeb4f9dbf2270bc2071d5dd1d3fe1f739 Mon Sep 17 00:00:00 2001 From: Sean Aery Date: Thu, 13 Nov 2025 11:55:36 -0500 Subject: [PATCH 2/5] WIP: Try to get arclight working on BL9.0.0.beta8 by providing index param. - may be best to modify BL MetadataFieldLayoutComponent so index param defaults to 0 if not provided --- app/components/arclight/embed_component.rb | 4 ++-- .../arclight/repository_location_component.html.erb | 4 ++-- app/components/arclight/upper_metadata_layout_component.rb | 5 +++-- lib/generators/arclight/templates/arclight.scss | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/components/arclight/embed_component.rb b/app/components/arclight/embed_component.rb index 9961590c7..80579fabc 100644 --- a/app/components/arclight/embed_component.rb +++ b/app/components/arclight/embed_component.rb @@ -3,10 +3,10 @@ module Arclight # Render digital object links for a document class EmbedComponent < ViewComponent::Base - def initialize(document:, presenter:, **kwargs) # rubocop:disable Lint/UnusedMethodArgument + def initialize(presenter:, document_counter: nil, **kwargs) # rubocop:disable Lint/UnusedMethodArgument super() - @document = document + @document = presenter.document @presenter = presenter end diff --git a/app/components/arclight/repository_location_component.html.erb b/app/components/arclight/repository_location_component.html.erb index e875a059b..4813eed82 100644 --- a/app/components/arclight/repository_location_component.html.erb +++ b/app/components/arclight/repository_location_component.html.erb @@ -1,8 +1,8 @@ -<%= render(@layout.new(field: @field)) do |component| %> +<%= render(@layout.new(field: @field, index: 0)) do |component| %> <% component.with_label do %> <%= label %> <% end %> - <% component.with_value do %> + <% component.with_value(index: 0) do %>
<% if repository.thumbnail_url %> <%= image_tag repository.thumbnail_url, alt: '', class: 'img-fluid float-left' %> diff --git a/app/components/arclight/upper_metadata_layout_component.rb b/app/components/arclight/upper_metadata_layout_component.rb index 226230fd1..e9a492630 100644 --- a/app/components/arclight/upper_metadata_layout_component.rb +++ b/app/components/arclight/upper_metadata_layout_component.rb @@ -3,8 +3,9 @@ module Arclight # Override upstream to add an offset bootstrap column class class UpperMetadataLayoutComponent < Blacklight::MetadataFieldLayoutComponent - def initialize(field:, label_class: 'col-md-3 offset-md-1', value_class: 'col-md-8') - super + def initialize(field:, index: 0, label_class: 'col-md-3 offset-md-1', value_class: 'col-md-8') + @index = index + super(field: field, label_class: label_class, value_class: value_class) end end end diff --git a/lib/generators/arclight/templates/arclight.scss b/lib/generators/arclight/templates/arclight.scss index 770982ec3..6421b6e95 100644 --- a/lib/generators/arclight/templates/arclight.scss +++ b/lib/generators/arclight/templates/arclight.scss @@ -3,4 +3,5 @@ } // Arclight, imported from arclight frontend package -@import 'arclight/app/assets/stylesheets/arclight/application'; +//@import 'arclight/app/assets/stylesheets/arclight/application'; +@import '../../../arclight/app/assets/stylesheets/arclight/application'; From 883cdb49f4bf4d3529de611383c246ed389f3054 Mon Sep 17 00:00:00 2001 From: Sean Aery Date: Thu, 13 Nov 2025 19:58:09 -0500 Subject: [PATCH 3/5] WIP: fix FrozenError: can't modify frozen Array in CI --- spec/spec_helper.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 79bb31fcc..213242dc6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -10,8 +10,19 @@ end require 'engine_cart' + EngineCart.load_application! +# Rails 7.1.3+ freezes certain internal arrays for +# performance and safety. Rails::Engine.paths["app"] is frozen +# but EngineCart tries to modify it, leading to errors like: +# Failure/Error: EngineCart.load_application! +# FrozenError: can't modify frozen Array +Rails::Engine.subclasses.each do |engine| + paths = engine.paths['app'] + engine.paths['app'] = paths.dup unless paths.frozen? +end + require 'rspec/rails' require 'selenium-webdriver' From f409a35ac3e1b2a22f1812892ec2474c91844392 Mon Sep 17 00:00:00 2001 From: Sean Aery Date: Fri, 14 Nov 2025 22:09:47 -0500 Subject: [PATCH 4/5] fixup --- .../arclight/search_result_component.html.erb | 4 ++-- .../search_result_title_component.html.erb | 10 +++++----- spec/spec_helper.rb | 16 +++++++++++----- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/app/components/arclight/search_result_component.html.erb b/app/components/arclight/search_result_component.html.erb index e48a857ea..cf2bcf4d2 100644 --- a/app/components/arclight/search_result_component.html.erb +++ b/app/components/arclight/search_result_component.html.erb @@ -1,11 +1,11 @@ <%= content_tag @component, id: @id, data: { - 'document-id': @document.id.to_s.parameterize, + 'document-id': presenter.document.id.to_s.parameterize, 'document-counter': @counter, }, itemscope: true, - itemtype: @document.itemtype, + itemtype: presenter.document.itemtype, class: classes.flatten.join(' ') do %>
<%= icon %> diff --git a/app/components/arclight/search_result_title_component.html.erb b/app/components/arclight/search_result_title_component.html.erb index ec90363ba..02bd9c346 100644 --- a/app/components/arclight/search_result_title_component.html.erb +++ b/app/components/arclight/search_result_title_component.html.erb @@ -1,12 +1,12 @@ -
+

- <%= helpers.link_to_document @document, counter: @counter %> - <% @document.extent.each do |extent| %> + <%= helpers.link_to_document presenter.document, counter: @counter %> + <% presenter.document.extent.each do |extent| %> <%= tag.span extent, class: 'al-document-extent badge' unless compact? %> <% end %> <%= tag.span class: 'al-document-container text-muted' do %> - <%= @document.containers.join(', ') %> - <% end if @document.containers.present? %> + <%= presenter.document.containers.join(', ') %> + <% end if presenter.document.containers.present? %>

<% actions.each do |action| %> diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 213242dc6..7b7cec2e9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -11,18 +11,24 @@ require 'engine_cart' -EngineCart.load_application! - # Rails 7.1.3+ freezes certain internal arrays for # performance and safety. Rails::Engine.paths["app"] is frozen # but EngineCart tries to modify it, leading to errors like: # Failure/Error: EngineCart.load_application! # FrozenError: can't modify frozen Array -Rails::Engine.subclasses.each do |engine| - paths = engine.paths['app'] - engine.paths['app'] = paths.dup unless paths.frozen? +# We need to patch Rails::Engine to prevent path freezing during EngineCart loading +module Rails + class Engine + def freeze_config + # Override to prevent freezing of config arrays that EngineCart needs to modify + # This is a temporary workaround for EngineCart compatibility with Rails 7.1.3+ + @config.freeze unless defined?(EngineCart) + end + end end +EngineCart.load_application! + require 'rspec/rails' require 'selenium-webdriver' From 345e59db91dd404fb121e936e63ce9f0b33b8dde Mon Sep 17 00:00:00 2001 From: Sean Aery Date: Fri, 14 Nov 2025 17:01:26 -0500 Subject: [PATCH 5/5] WIP - fix BL9 compat; ensure SearchResultTitleComponent is instantiated w/presenter instead of document --- app/components/arclight/search_result_component.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/arclight/search_result_component.html.erb b/app/components/arclight/search_result_component.html.erb index cf2bcf4d2..e5e327db5 100644 --- a/app/components/arclight/search_result_component.html.erb +++ b/app/components/arclight/search_result_component.html.erb @@ -11,7 +11,7 @@ <%= icon %>
- <%= render Arclight::SearchResultTitleComponent.new(document: document, compact: compact?) %> + <%= render Arclight::SearchResultTitleComponent.new(presenter: presenter, compact: compact?) %>
<%= metadata %>