-
Notifications
You must be signed in to change notification settings - Fork 252
Description
When on a record show page, Blacklight::Solr::Repository#fetch creates a new SingleDocSearchBuilder. The first argument is self, that is to say, an instance of Blacklight::Solr::Repository:
| doc_params = SingleDocSearchBuilder.new(self, id, params) |
SingleDocSearchBuilder calls super on that first argument:
| super(scope) |
And we then try to use it to create a Blacklight::SearchState or similar, as the third argument:
| @search_state = search_state_class.new(@blacklight_params, @scope&.blacklight_config, @scope) |
But yikes, the third argument to Blacklight::SearchState's constructor is supposed to be a controller, not a solr repository:
blacklight/lib/blacklight/search_state.rb
Line 21 in 9ba4ae9
| def initialize(params, blacklight_config, controller = nil) |
This doesn't cause trouble in stock blacklight, but if you have customized the search builder to include something that relies on, say search_state.controller&.action_name, you will get
*** NoMethodError Exception: undefined method 'action_name' for an instance of Blacklight::Solr::Repository