Skip to content

Commit

Permalink
Merge pull request #2342 from projectblacklight/regression
Browse files Browse the repository at this point in the history
Fix search bar component with only 1 search field
  • Loading branch information
jkeck committed Oct 1, 2020
2 parents 133f58a + b010bf5 commit 68672b9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/components/blacklight/search_bar_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
id: "#{@prefix}search_field",
class: "custom-select search-field") %>
<% elsif @search_fields.length == 1 %>
<%= hidden_field_tag :search_field, search_fields.first.last %>
<%= hidden_field_tag :search_field, @search_fields.first.last %>
<% end %>

<label for="<%= @prefix %>q" class="sr-only"><%= t('blacklight.search.form.search.label') %></label>
Expand Down
2 changes: 1 addition & 1 deletion app/components/blacklight/search_bar_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Blacklight
class SearchBarComponent < ::ViewComponent::Base
# rubocop:disable Metrics/ParameterLists
def initialize(url:, params:, classes: [], presenter: nil, prefix: '', method: 'GET', q: nil, search_field: nil, search_fields: [], autocomplete_path: nil, autofocus: nil)
def initialize(url:, params:, classes: ['search-query-form'], presenter: nil, prefix: '', method: 'GET', q: nil, search_field: nil, search_fields: [], autocomplete_path: nil, autofocus: nil)
@url = url
@q = q || params[:q]
@search_field = search_field || params[:search_field]
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_show_main_content.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// This document_partial_name(@document) business is not quite right,
// but has been there for a while.
-->
<span class="Z3988" title="<%= @document.export_as_openurl_ctx_kev(@view_context.document_partial_name(@document)) %>"></span>
<span class="Z3988" title="<%= @document.export_as_openurl_ctx_kev(document_partial_name(@document)) %>"></span>
<% end %>
<% end %>
Expand Down

0 comments on commit 68672b9

Please sign in to comment.