"Parent task is invalid" while editing child issues with restricted Issues Visibility (#12851).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11228 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2013-01-20 16:41:31 +00:00
parent d0888b2f71
commit f99535bba2
2 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -430,7 +430,7 @@ class Issue < ActiveRecord::Base
if attrs['parent_issue_id'].present?
s = attrs['parent_issue_id'].to_s
unless (m = s.match(%r{\A#?(\d+)\z})) && Issue.visible(user).exists?(m[1])
unless (m = s.match(%r{\A#?(\d+)\z})) && (m[1] == parent_id.to_s || Issue.visible(user).exists?(m[1]))
@invalid_parent_issue_id = attrs.delete('parent_issue_id')
end
end