diff --git a/app/assets/javascripts/hyrax/search.js b/app/assets/javascripts/hyrax/search.js index 83e43698aa..d7aead5ab9 100644 --- a/app/assets/javascripts/hyrax/search.js +++ b/app/assets/javascripts/hyrax/search.js @@ -4,6 +4,7 @@ this.init = function() { this.$label = this.$element.find('[data-search-element="label"]'); + this.$visibleLabel = this.$element.find('.dropdown-toggle').find('span[aria-hidden="true"]'); this.$items = this.$element.find('[data-search-option]'); this.setDefault(); } @@ -12,7 +13,6 @@ this.attachEvents(); } - Hyrax.Search.prototype = { attachEvents: function() { @@ -43,6 +43,7 @@ setLabel: function(label) { this.$label.html(label); + this.$visibleLabel.html(label); } } @@ -58,8 +59,6 @@ })(jQuery); - Blacklight.onLoad(function() { $('#search-form-header').search(); }); - diff --git a/app/services/hyrax/analytics/matomo.rb b/app/services/hyrax/analytics/matomo.rb index ac9c83c32f..06a0582cd9 100644 --- a/app/services/hyrax/analytics/matomo.rb +++ b/app/services/hyrax/analytics/matomo.rb @@ -165,9 +165,9 @@ def results_array(response, metric) if result[1].empty? results.push([result[0].to_date, 0]) elsif result[1].is_a?(Array) - results.push([result[0].to_date, result[1].first[metric]]) + results.push([result[0].to_date, result[1].first[metric].to_i]) else - results.push([result[0].to_date, result[1][metric].presence || 0]) + results.push([result[0].to_date, result[1][metric].presence.to_i]) end end Hyrax::Analytics::Results.new(results) diff --git a/app/services/hyrax/custom_queries/find_file_metadata.rb b/app/services/hyrax/custom_queries/find_file_metadata.rb index b155cae6c3..f2343344d5 100644 --- a/app/services/hyrax/custom_queries/find_file_metadata.rb +++ b/app/services/hyrax/custom_queries/find_file_metadata.rb @@ -31,7 +31,7 @@ def find_file_metadata_by(id:) result = query_service.find_by(id: id) unless result.is_a? Hyrax::FileMetadata raise ::Valkyrie::Persistence::ObjectNotFoundError, - "Result type #{result.internal_resource} for id #{id} is not a `Hyrax::FileMetadata`" + "Result type #{result&.internal_resource} for id #{id} is not a `Hyrax::FileMetadata`" end result end @@ -44,7 +44,7 @@ def find_file_metadata_by_alternate_identifier(alternate_identifier:) result = query_service.find_by_alternate_identifier(alternate_identifier: alternate_identifier) unless result.is_a? Hyrax::FileMetadata raise ::Valkyrie::Persistence::ObjectNotFoundError, - "Result type #{result.internal_resource} for alternate_identifier #{alternate_identifier} is not a `Hyrax::FileMetadata`" + "Result type #{result&.internal_resource} for alternate_identifier #{alternate_identifier} is not a `Hyrax::FileMetadata`" end result end diff --git a/app/views/catalog/_search_form.html.erb b/app/views/catalog/_search_form.html.erb index 730a5d13e0..1b32ab52ee 100644 --- a/app/views/catalog/_search_form.html.erb +++ b/app/views/catalog/_search_form.html.erb @@ -20,24 +20,17 @@ <%= t("hyrax.search.form.option.all.label_long", application_name: application_name) %> - - + <% end %> - + <% end %>