Skip to content

Commit 2aed628

Browse files
committed
Merge pull request #618 from projectblacklight/search-results-view
deprecate session[:search][:results_view], as any code consuming that in...
2 parents 9cd45e3 + 57ccb73 commit 2aed628

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

app/helpers/blacklight/blacklight_helper_behavior.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,10 @@ def render_document_index_label doc, opts
477477
# Use the catalog_path RESTful route to create a link to the show page for a specific item.
478478
# catalog_path accepts a HashWithIndifferentAccess object. The solr query params are stored in the session,
479479
# so we only need the +counter+ param here. We also need to know if we are viewing to document as part of search results.
480-
def link_to_document(doc, opts={:label=>nil, :counter => nil, :results_view => true})
480+
def link_to_document(doc, opts={:label=>nil, :counter => nil})
481481
opts[:label] ||= blacklight_config.index.show_link.to_sym
482482
label = render_document_index_label doc, opts
483-
link_to label, doc, { :'data-counter' => opts[:counter] }.merge(opts.reject { |k,v| [:label, :counter, :results_view].include? k })
483+
link_to label, doc, { :'data-counter' => opts[:counter] }.merge(opts.reject { |k,v| [:label, :counter].include? k })
484484
end
485485

486486
# link_back_to_catalog(:label=>'Back to Search')

lib/blacklight/catalog.rb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ def show
7777

7878
# updates the search counter (allows the show view to paginate)
7979
def update
80-
adjust_for_results_view
8180
session[:search][:counter] = params[:counter]
8281
redirect_to :action => "show"
8382
end
@@ -266,13 +265,9 @@ def set_additional_search_session_values
266265
# we need to know if we are viewing the item as part of search results so we know whether to
267266
# include certain partials or not
268267
def adjust_for_results_view
269-
if params[:results_view] == "false"
270-
session[:search][:results_view] = false
271-
else
272-
session[:search][:results_view] = true
273-
end
268+
# deprecated in blacklight 4.x
269+
ActiveSupport::Deprecation.warn("#adjust_for_results_view helper was deprecated in Blacklight 4.x")
274270
end
275-
276271

277272
# when solr (RSolr) throws an error (RSolr::RequestError), this method is executed.
278273
def rsolr_request_error(exception)

0 commit comments

Comments
 (0)