app/controllers/search_controller.rb in umlaut-4.1.0.pre.2 vs app/controllers/search_controller.rb in umlaut-4.1.0.pre3
- old
+ new
@@ -96,14 +96,16 @@
if (@page == 1) && (@display_results.length == 1)
# If we narrowed down to one result redirect
# to resolve action.
redirect_to( url_for_with_co({:controller => 'resolve'}, @display_results[0]) )
- elsif (@display_results.length == 0)
- # 0 hits, do it too.
+ elsif (@display_results.length == 0) && (umlaut_config.lookup!("search.display_zero_hit_results") != true)
+ # If we have 0 hits, also redirect to resolve, unless config tells
+ # us not to.
redirect_to( url_for_with_co({:controller => 'resolve'}, @search_context_object) )
end
- @page_title = 'Journal titles that '
+
+ @page_title = @display_results.length > 0 ? 'Journal titles that ' : 'No journal titles found that '
@page_title +=
(params["umlaut.title_search_type"] == "begins") ?
'begin with ' : 'contain '
@page_title += "'" + params['rft.jtitle'] + "'"
end
\ No newline at end of file