1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-03-10 19:23:06 +00:00

Merged r17949 to 3.4-stable (#29055).

git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@17951 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2019-03-15 07:30:02 +00:00
parent d35594d444
commit 6626f87e55
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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