diff --git a/app/helpers/blacklight/blacklight_helper_behavior.rb b/app/helpers/blacklight/blacklight_helper_behavior.rb index f9566c03b7..7ca5b29bfd 100644 --- a/app/helpers/blacklight/blacklight_helper_behavior.rb +++ b/app/helpers/blacklight/blacklight_helper_behavior.rb @@ -86,6 +86,7 @@ def extra_body_classes def render_document_list_partial options={} render :partial=>'catalog/document_list' end + deprecation_deprecate :render_document_list_partial # Save function area for search results 'index' view, normally # renders next to title. @@ -103,6 +104,10 @@ def render_index_doc_actions(document, options={}) def render_show_doc_actions(document=@document, options={}) # I'm not sure why this key is documentFunctions and #render_index_doc_actions uses wrapping_class. # TODO: remove documentFunctions key in Blacklight 5.x + if options.has_key? :documentFunctions + Deprecation.warn(Blacklight::BlacklightHelperBehavior, "Calling #render_show_doc_actions with the :documentFunctions option is deprecated; use :wrapping_class instead") + end + wrapping_class = options.delete(:documentFunctions) || options.delete(:wrapping_class) || "documentFunctions" content = [] diff --git a/app/helpers/blacklight/render_constraints_helper_behavior.rb b/app/helpers/blacklight/render_constraints_helper_behavior.rb index 6c0f7abe02..526645ed53 100644 --- a/app/helpers/blacklight/render_constraints_helper_behavior.rb +++ b/app/helpers/blacklight/render_constraints_helper_behavior.rb @@ -77,6 +77,10 @@ def render_filter_element(facet, values, localized_params) # [:escape_value] # default true, HTML escape. def render_constraint_element(label, value, options = {}) + if (options[:escape_label] and !label.html_safe?) or (options.has_key?(:escape_value) and !value.html_safe?) + 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") + end + render(:partial => "catalog/constraints_element", :locals => {:label => label, :value => value, :options => options}) end diff --git a/lib/railties/blacklight.rake b/lib/railties/blacklight.rake index 3cc78cc192..ce03444089 100644 --- a/lib/railties/blacklight.rake +++ b/lib/railties/blacklight.rake @@ -10,6 +10,13 @@ namespace :blacklight do Search.delete_old_searches(args[:days_old].to_i) end + namespace :solr do + desc "Put sample data into solr" + task :seed do + Rake::Task["solr:marc:index_test_data"].invoke + end + end + end diff --git a/spec/helpers/blacklight_helper_spec.rb b/spec/helpers/blacklight_helper_spec.rb index 438a3e65b1..a8b9b70c97 100644 --- a/spec/helpers/blacklight_helper_spec.rb +++ b/spec/helpers/blacklight_helper_spec.rb @@ -90,7 +90,7 @@ def blacklight_config def current_search_session end - + describe "deprecated methods" do describe "#index_field_names" do it "should warn" do @@ -113,6 +113,14 @@ def current_search_session helper.document_show_field_labels end end + + describe "#render_document_list_partial" do + it "should warn" do + expect(Blacklight::BlacklightHelperBehavior.deprecation_behavior.first).to receive(:call) + helper.stub(:render) + helper.render_document_list_partial + end + end end describe "#application_name", :test => true do