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:
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:
|
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
When on a record show page, Blacklight::Solr::Repository#fetch creates a new
SingleDocSearchBuilder. The first argument isself, that is to say, an instance ofBlacklight::Solr::Repository:blacklight/lib/blacklight/solr/repository.rb
Line 10 in b969eac
SingleDocSearchBuildercallssuperon that first argument:blacklight/lib/blacklight/solr/single_doc_search_builder.rb
Line 10 in 9ba4ae9
And we then try to use it to create a
Blacklight::SearchStateor similar, as the third argument:blacklight/lib/blacklight/search_builder.rb
Line 32 in 9ba4ae9
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
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