Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 6 additions & 1 deletion app/controllers/concerns/spotlight/search_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/spotlight/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading