app/models/spotlight/blacklight_configuration.rb in blacklight-spotlight-2.2.0 vs app/models/spotlight/blacklight_configuration.rb in blacklight-spotlight-2.2.1
- old
+ new
@@ -83,11 +83,10 @@
config.view.embed.if = false
config.view.embed.locals ||= { osd_container_class: '' }
# Add any custom fields
config.index_fields.merge! custom_index_fields(config)
- config.index_fields = Hash[config.index_fields.sort_by { |k, _v| field_weight(index_fields, k) }]
config.index_fields.reject! { |_k, v| v.if == false }
# Update with customizations
config.index_fields.each do |k, v|
v.original = v.dup
@@ -126,9 +125,13 @@
v.if = :field_enabled? unless v.if == false
v.normalize! config
v.validate!
end
+
+ ##
+ # Sort after the show fields have also been added
+ config.index_fields = Hash[config.index_fields.sort_by { |k, _v| field_weight(index_fields, k) }]
config.show_fields = config.index_fields
unless search_fields.blank?
config.search_fields = Hash[config.search_fields.sort_by { |k, _v| field_weight(search_fields, k) }]