summaryrefslogtreecommitdiffstats
path: root/app/controllers/issue_relations_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-02-12 18:35:31 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-02-12 18:35:31 +0000
commit55a3ac764f191c097e80345d413bde3da92ce615 (patch)
tree66c2d885a1be3c24f67e0f04232d4286d0c461fd /app/controllers/issue_relations_controller.rb
parent541d830d2a968f36d73add2b1e3693eab09136ed (diff)
downloadredmine-55a3ac764f191c097e80345d413bde3da92ce615.tar.gz
redmine-55a3ac764f191c097e80345d413bde3da92ce615.zip
Issue relation: fixes error with postgres when entering a non-numeric id (#4820) + accept hash (#) before id.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3413 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issue_relations_controller.rb')
-rw-r--r--app/controllers/issue_relations_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/issue_relations_controller.rb b/app/controllers/issue_relations_controller.rb
index 8a41c3830..9ce358584 100644
--- a/app/controllers/issue_relations_controller.rb
+++ b/app/controllers/issue_relations_controller.rb
@@ -21,8 +21,8 @@ class IssueRelationsController < ApplicationController
def new
@relation = IssueRelation.new(params[:relation])
@relation.issue_from = @issue
- if params[:relation] && !params[:relation][:issue_to_id].blank?
- @relation.issue_to = Issue.visible.find_by_id(params[:relation][:issue_to_id])
+ if params[:relation] && m = params[:relation][:issue_to_id].to_s.match(/^#?(\d+)$/)
+ @relation.issue_to = Issue.visible.find_by_id(m[1].to_i)
end
@relation.save if request.post?
respond_to do |format|