summaryrefslogtreecommitdiffstats
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-03-14 09:53:36 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-03-14 09:53:36 +0000
commit5e1d042c40ac8d2b19ab7c7c951623386d93191b (patch)
tree915794c0fafd82b91cebd23178e6f73016a28cf5 /app/models/issue.rb
parentb5bf65e834e4b77a425fb772445f9bfe4cf48e64 (diff)
downloadredmine-5e1d042c40ac8d2b19ab7c7c951623386d93191b.tar.gz
redmine-5e1d042c40ac8d2b19ab7c7c951623386d93191b.zip
Fixed that creating an issue without tracker_id attribute ignores custom field values (#19368).
git-svn-id: http://svn.redmine.org/redmine/trunk@14083 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 8df0082d0..57bfa41e0 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -447,6 +447,11 @@ class Issue < ActiveRecord::Base
if (t = attrs.delete('tracker_id')) && safe_attribute?('tracker_id')
self.tracker_id = t
end
+ if project
+ # Set the default tracker to accept custom field values
+ # even if tracker is not specified
+ self.tracker ||= project.trackers.first
+ end
if (s = attrs.delete('status_id')) && safe_attribute?('status_id')
if new_statuses_allowed_to(user).collect(&:id).include?(s.to_i)