diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index bc9610a2d..9cf4138b6 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -18,6 +18,11 @@ jobs: additional_engine_cart_rails_options: ["-j importmap"] additional_name: [""] include: + - rails_version: "~> 8.0" + ruby: "3.4" + blacklight_version: "~> 9.0.0.beta7" + additional_engine_cart_rails_options: "-j importmap" + additional_name: Blacklight 9 beta - rails_version: "~> 7.2" ruby: "3.3" blacklight_version: "~> 8.0" diff --git a/app/controllers/concerns/spotlight/search_helper.rb b/app/controllers/concerns/spotlight/search_helper.rb index 45dc8c185..f449168e3 100644 --- a/app/controllers/concerns/spotlight/search_helper.rb +++ b/app/controllers/concerns/spotlight/search_helper.rb @@ -3,10 +3,15 @@ module Spotlight # ... module SearchHelper + # @param [Hash] user_params the query parameters used to reconstitute the search state + # from saved searches. If not provided, will use the search_state from the view context + # or an empty hash if that is not available. + # @return [Object] An instance of the configured search service def search_service(user_params = respond_to?(:search_state, true) ? search_state.to_h : {}) + state = Blacklight::SearchState.new(user_params, blacklight_config) klass = respond_to?(:search_service_class) ? search_service_class : Blacklight::SearchService - klass.new(config: blacklight_config, user_params:, **search_service_context) + klass.new(config: blacklight_config, search_state: state, **search_service_context) end # @return [Hash] a hash of context information to pass through to the search service diff --git a/app/controllers/spotlight/pages_controller.rb b/app/controllers/spotlight/pages_controller.rb index f87eae1e2..f0f49b1b3 100644 --- a/app/controllers/spotlight/pages_controller.rb +++ b/app/controllers/spotlight/pages_controller.rb @@ -121,7 +121,7 @@ def _prefixes # @param [Hash] the query parameters # @return [Object] the search results object from the configured search service def search_results(user_params) - search_service(user_params).search_results + search_service(search_state: Blacklight::SearchState.new(user_params, blacklight_config)).search_results end def undo_link