summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2019-03-15 07:29:10 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2019-03-15 07:29:10 +0000
commit4833318c3dcb6e4c4735ee4e0438ac6765d41d7a (patch)
tree2a2b4f9e1b086b896c22ec974c1a65b6f5c6aae1
parentfd12dc6a54fc77fa78b08ed77b937fe963bcfa21 (diff)
downloadredmine-4833318c3dcb6e4c4735ee4e0438ac6765d41d7a.tar.gz
redmine-4833318c3dcb6e4c4735ee4e0438ac6765d41d7a.zip
Merged r17949 to 4.0-stable (#29055).
git-svn-id: http://svn.redmine.org/redmine/branches/4.0-stable@17950 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/search_controller.rb2
-rw-r--r--test/integration/api_test/search_test.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index 744c3a3cb..e192b855b 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -37,7 +37,7 @@ class SearchController < ApplicationController
end
# quick jump to an issue
- if (m = @question.match(/^#?(\d+)$/)) && (issue = Issue.visible.find_by_id(m[1].to_i))
+ if !api_request? && (m = @question.match(/^#?(\d+)$/)) && (issue = Issue.visible.find_by_id(m[1].to_i))
redirect_to issue_path(issue)
return
end
diff --git a/test/integration/api_test/search_test.rb b/test/integration/api_test/search_test.rb
index 2c14ed4ac..354f5f27b 100644
--- a/test/integration/api_test/search_test.rb
+++ b/test/integration/api_test/search_test.rb
@@ -89,4 +89,9 @@ class Redmine::ApiTest::SearchTest < Redmine::ApiTest::Base
assert_equal 4, json['limit']
assert_equal issue[8..10], json['results'].map {|r| r['id']}
end
+
+ test "GET /search.xml should not quick jump to the issue with given id" do
+ get '/search.xml', :params => {:q => '3'}
+ assert_response :success
+ end
end