File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ def index
63
63
@object_types = @object_types . select { |o | User . current . allowed_to? ( "view_#{ o } " . to_sym , projects_to_search ) }
64
64
end
65
65
66
- @scope = @object_types . select { |t | params [ t ] }
66
+ @scope = @object_types . select { |t | params [ t ] . present? }
67
67
@scope = @object_types if @scope . empty?
68
68
69
69
fetcher = Redmine ::Search ::Fetcher . new (
Original file line number Diff line number Diff line change @@ -428,4 +428,19 @@ def test_keywords_should_be_highlighted
428
428
assert_select 'dd span.highlight' , :text => 'highlighted'
429
429
end
430
430
end
431
+
432
+ def test_search_should_exclude_empty_modules_params
433
+ @request . session [ :user_id ] = 1
434
+
435
+ get :index , params : {
436
+ q : "private" ,
437
+ scope : "all" ,
438
+ issues : "1" ,
439
+ projects : nil
440
+ }
441
+
442
+ assert_response :success
443
+
444
+ assert_select '#search-results dt.project' , 0
445
+ end
431
446
end
You can’t perform that action at this time.
0 commit comments