Skip to content

Commit 1bd9181

Browse files
committed
Merge pull request #752 from projectblacklight/4x-deprecation
Deprecation warnings for features removed in #751
2 parents 1742da4 + cda9ec4 commit 1bd9181

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

app/helpers/blacklight/blacklight_helper_behavior.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def extra_body_classes
8686
def render_document_list_partial options={}
8787
render :partial=>'catalog/document_list'
8888
end
89+
deprecation_deprecate :render_document_list_partial
8990

9091
# Save function area for search results 'index' view, normally
9192
# renders next to title.
@@ -103,6 +104,10 @@ def render_index_doc_actions(document, options={})
103104
def render_show_doc_actions(document=@document, options={})
104105
# I'm not sure why this key is documentFunctions and #render_index_doc_actions uses wrapping_class.
105106
# TODO: remove documentFunctions key in Blacklight 5.x
107+
if options.has_key? :documentFunctions
108+
Deprecation.warn(Blacklight::BlacklightHelperBehavior, "Calling #render_show_doc_actions with the :documentFunctions option is deprecated; use :wrapping_class instead")
109+
end
110+
106111
wrapping_class = options.delete(:documentFunctions) || options.delete(:wrapping_class) || "documentFunctions"
107112

108113
content = []

app/helpers/blacklight/render_constraints_helper_behavior.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ def render_filter_element(facet, values, localized_params)
7777
# [:escape_value]
7878
# default true, HTML escape.
7979
def render_constraint_element(label, value, options = {})
80+
if (options[:escape_label] and !label.html_safe?) or (options.has_key?(:escape_value) and !value.html_safe?)
81+
Deprecation.warn(Blacklight::RenderConstraintsHelperBehavior, "Calling #render_constraint_element with :escape_label or :escape_value parameters is deprecated; make sure your values are #html_safe instead")
82+
end
83+
8084
render(:partial => "catalog/constraints_element", :locals => {:label => label, :value => value, :options => options})
8185
end
8286

lib/railties/blacklight.rake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ namespace :blacklight do
1010
Search.delete_old_searches(args[:days_old].to_i)
1111
end
1212

13+
namespace :solr do
14+
desc "Put sample data into solr"
15+
task :seed do
16+
Rake::Task["solr:marc:index_test_data"].invoke
17+
end
18+
end
19+
1320
end
1421

1522

spec/helpers/blacklight_helper_spec.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def blacklight_config
9090
def current_search_session
9191

9292
end
93-
93+
9494
describe "deprecated methods" do
9595
describe "#index_field_names" do
9696
it "should warn" do
@@ -113,6 +113,14 @@ def current_search_session
113113
helper.document_show_field_labels
114114
end
115115
end
116+
117+
describe "#render_document_list_partial" do
118+
it "should warn" do
119+
expect(Blacklight::BlacklightHelperBehavior.deprecation_behavior.first).to receive(:call)
120+
helper.stub(:render)
121+
helper.render_document_list_partial
122+
end
123+
end
116124
end
117125

118126
describe "#application_name", :test => true do

0 commit comments

Comments
 (0)