Project

General

Profile

Patch #26104 ยป 0001-Quick-jump-to-issue-only-if-searching-for-issues.patch

Holger Just, 2017-06-06 15:31

View differences:

app/controllers/search_controller.rb
@limit = 10 if @limit == 0
end
# quick jump to an issue
if (m = @question.match(/^#?(\d+)$/)) && (issue = Issue.visible.find_by_id(m[1].to_i))
redirect_to issue_path(issue)
return
end
projects_to_search =
case params[:scope]
when 'all'
......
@scope = @object_types.select {|t| params[t]}
@scope = @object_types if @scope.empty?
# quick jump to an issue
if @scope.include?('issues') && (m = @question.match(/^#?(\d+)$/)) && (issue = Issue.visible.find_by_id(m[1].to_i))
redirect_to issue_path(issue)
return
end
fetcher = Redmine::Search::Fetcher.new(
@question, User.current, @scope, projects_to_search,
:all_words => @all_words, :titles_only => @titles_only, :attachments => @search_attachments, :open_issues => @open_issues,
    (1-1/1)