Defect #34615 » 0001-Ignore-from-search-module-params-sent-with-empty-val.patch
| app/controllers/search_controller.rb | ||
|---|---|---|
|
@object_types = @object_types.select {|o| User.current.allowed_to?("view_#{o}".to_sym, projects_to_search)}
|
||
|
end
|
||
|
@scope = @object_types.select {|t| params[t]}
|
||
|
@scope = @object_types.select {|t| params[t].present?}
|
||
|
@scope = @object_types if @scope.empty?
|
||
|
fetcher = Redmine::Search::Fetcher.new(
|
||
| test/functional/search_controller_test.rb | ||
|---|---|---|
|
assert_select 'dd span.highlight', :text => 'highlighted'
|
||
|
end
|
||
|
end
|
||
|
def test_search_should_exclude_empty_modules_params
|
||
|
@request.session[:user_id] = 1
|
||
|
get :index, params: {
|
||
|
q: "private",
|
||
|
scope: "all",
|
||
|
issues: "1",
|
||
|
projects: nil
|
||
|
}
|
||
|
assert_response :success
|
||
|
assert_select '#search-results dt.project', 0
|
||
|
end
|
||
|
end
|
||