I'm seeing some cases in a development server (puma) where these values are not "remembered" by the code that needs them.
https://github.com/projectblacklight/spotlight/blob/main/lib/spotlight/engine.rb#L251-L262
This is manifesting as:
Blacklight::Exceptions::InvalidRequest in Spotlight::CatalogController#admin
RSolr::Error::Http - 400 Bad Request
Error: Can't determine a Sort Order (asc or desc) in sort spec ' desc', pos=5
because blacklight_config.index.timestamp_field is nil when we try to use it here:
|
solr_params = { sort: "#{blacklight_config.index.timestamp_field} desc" } |
When I set a breakpoint in the Engine and one where the value is used it appears to be a different object:
# In the Engine
(ruby) Blacklight::Configuration.default_values[:index].object_id
85700
# In the SearchBuilder
Blacklight::Configuration.default_values[:index].object_id
156400
Blacklight::Configuration.default_values[:index].thumbnail_field
nil
This happens because the Blacklight initializer runs later and overwrites the configs set by Spotlight: https://github.com/projectblacklight/blacklight/blob/9e517006cf8373af1d623c2664276038a2258b2e/lib/blacklight/engine.rb#L9-L11
This was introduced in projectblacklight/blacklight#2826
I'm seeing some cases in a development server (puma) where these values are not "remembered" by the code that needs them.
https://github.com/projectblacklight/spotlight/blob/main/lib/spotlight/engine.rb#L251-L262
This is manifesting as:
because
blacklight_config.index.timestamp_fieldisnilwhen we try to use it here:spotlight/app/controllers/spotlight/dashboards_controller.rb
Line 54 in 76a2b43
When I set a breakpoint in the Engine and one where the value is used it appears to be a different object:
This happens because the Blacklight initializer runs later and overwrites the configs set by Spotlight: https://github.com/projectblacklight/blacklight/blob/9e517006cf8373af1d623c2664276038a2258b2e/lib/blacklight/engine.rb#L9-L11
This was introduced in projectblacklight/blacklight#2826