Skip to content

Commit

Permalink
Don't pass nil to translation defaults.
Browse files Browse the repository at this point in the history
Workaround for rails/rails#19419
  • Loading branch information
jcoyne committed Mar 20, 2015
1 parent 1ee725b commit d2d25d5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/helpers/blacklight/configuration_helper_behavior.rb
Expand Up @@ -87,13 +87,11 @@ def document_show_field_label document, field
# Look up the label for the facet field
def facet_field_label field
field_config = blacklight_config.facet_fields[field]
defaults = [:"blacklight.search.fields.facet.#{field}", :"blacklight.search.fields.#{field}"]

This comment has been minimized.

Copy link
@cbeer

cbeer Mar 23, 2015

Member

@jcoyne do you remember why this is only needed for facets? Or should we do the same thing everywhere / add #compact to #field_label?

This comment has been minimized.

Copy link
@jcoyne

jcoyne Mar 23, 2015

Author Member

It probably should be everywhere (until Rails 4.2.2 is released), this was just where I found a failure in the suite.

defaults << field_config.label if field_config
defaults << field.to_s.humanize

field_label(
:"blacklight.search.fields.facet.#{field}",
:"blacklight.search.fields.#{field}",
(field_config.label if field_config),
field.to_s.humanize
)
field_label *defaults
end

def view_label view
Expand Down

0 comments on commit d2d25d5

Please sign in to comment.