app/models/spotlight/custom_search_field.rb in blacklight-spotlight-4.2.0 vs app/models/spotlight/custom_search_field.rb in blacklight-spotlight-4.3.0
- old
+ new
@@ -15,11 +15,11 @@
update_blacklight_configuration_label label
end
def label
- conf = if slug && blacklight_configuration && blacklight_configuration.search_fields.key?(slug)
+ conf = if slug && blacklight_configuration&.search_fields&.key?(slug)
blacklight_configuration.search_fields[slug].reverse_merge(configuration)
else
configuration
end
conf['label']
@@ -30,10 +30,10 @@
def blacklight_configuration
exhibit&.blacklight_configuration
end
def update_blacklight_configuration_label(label)
- return unless slug && blacklight_configuration && blacklight_configuration.search_fields.key?(slug)
+ return unless slug && blacklight_configuration&.search_fields&.key?(slug)
blacklight_configuration.search_fields[slug]['label'] = label
blacklight_configuration.save
end
end