app/models/spotlight/solr_document_sidecar.rb in blacklight-spotlight-3.0.0.rc3 vs app/models/spotlight/solr_document_sidecar.rb in blacklight-spotlight-3.0.0.rc4
- old
+ new
@@ -72,20 +72,21 @@
def configured_fields_data_to_solr
configured_fields = data.fetch('configured_fields', {})
upload_fields.each_with_object({}) do |field, solr_hash|
field_name = field.field_name.to_s
- next unless configured_fields && configured_fields[field_name].present?
value = configured_fields[field_name]
field_data = field.data_to_solr(convert_stored_value_to_solr(value))
# merge duplicate field mappings into a multivalued field
solr_hash.merge!(field_data) { |_key, v1, v2| (Array(v1) + Array(v2)).reject(&:blank?) }
end
end
def upload_fields
+ return [] unless document.uploaded_resource? || resource.is_a?(Spotlight::Resources::Upload)
+
Spotlight::Resources::Upload.fields(exhibit)
end
def custom_fields
exhibit.custom_fields.each_with_object({}) do |custom_field, hash|