Skip to content

Commit 01e0c3f

Browse files
committed
Add some more deprecations
1 parent 1e486d8 commit 01e0c3f

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

app/helpers/blacklight/facets_helper_behavior.rb

+11-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ def has_facet_values? fields = facet_field_names, response = nil
1717
'8.0.0')
1818
response = @response
1919
end
20-
facets_from_request(fields, response).any? { |display_facet| should_render_facet?(display_facet) }
20+
Deprecation.silence(Blacklight::FacetsHelperBehavior) do
21+
facets_from_request(fields, response).any? { |display_facet| should_render_facet?(display_facet) }
22+
end
2123
end
2224

2325
##
@@ -61,7 +63,6 @@ def render_facet_partials fields = nil, options = {}
6163
# @return [String]
6264
def render_facet_limit(display_facet, options = {})
6365
field_config = facet_configuration_for_field(display_facet.name)
64-
return unless should_render_facet?(display_facet, field_config)
6566

6667
if field_config.component
6768
component = field_config.component == true ? Blacklight::FacetFieldListComponent : field_config.component
@@ -76,6 +77,9 @@ def render_facet_limit(display_facet, options = {})
7677
Deprecation.warn(Blacklight::FacetsHelperBehavior, 'Calling #render_facet_limit on a non-componentized'\
7778
' facet is deprecated and will be removed in Blacklight 8')
7879

80+
Deprecation.silence(Blacklight::FacetsHelperBehavior) do
81+
return unless should_render_facet?(display_facet, field_config)
82+
end
7983
options = options.dup
8084
options[:partial] ||= facet_partial_name(display_facet)
8185
options[:layout] ||= "facet_layout" unless options.key?(:layout)
@@ -129,6 +133,7 @@ def should_render_facet? display_facet, facet_config = nil
129133
facet_config ||= facet_configuration_for_field(display_facet.name)
130134
should_render_field?(facet_config, display_facet)
131135
end
136+
deprecation_deprecate :should_render_facet?
132137

133138
##
134139
# Determine whether a facet should be rendered as collapsed or not.
@@ -164,10 +169,6 @@ def facet_field_presenter(facet_config, display_facet)
164169
Blacklight::FacetFieldPresenter.new(facet_config, display_facet, self)
165170
end
166171

167-
def facet_item_presenter(facet_config, facet_item, facet_field)
168-
Blacklight::FacetItemPresenter.new(facet_item, facet_config, self, facet_field)
169-
end
170-
171172
##
172173
# Standard display of a facet value in a list. Used in both _facets sidebar
173174
# partial and catalog/facet expanded list. Will output facet value name as
@@ -282,6 +283,10 @@ def facet_value_for_facet_item item
282283
end
283284
end
284285

286+
def facet_item_presenter(facet_config, facet_item, facet_field)
287+
Blacklight::FacetItemPresenter.new(facet_item, facet_config, self, facet_field)
288+
end
289+
285290
def facet_item_component(facet_config, facet_item, facet_field, **args)
286291
component = facet_config.fetch(:item_component, Blacklight::FacetItemComponent)
287292
component.new(facet_item: facet_item_presenter(facet_config, facet_item, facet_field), **args).with_view_context(self)

0 commit comments

Comments
 (0)