diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-12-29 17:36:01 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-12-29 17:36:01 +0000 |
commit | 21c0b868ae1d7836dcfe34ac0ad740df981e304d (patch) | |
tree | e0d7c5f3a40877009dc0b41e2da16d3ad5fb1855 /app/models | |
parent | df9ea24136059b502d156cb69c8bb2b9b6d952e1 (diff) | |
download | redmine-21c0b868ae1d7836dcfe34ac0ad740df981e304d.tar.gz redmine-21c0b868ae1d7836dcfe34ac0ad740df981e304d.zip |
Fixed: Tracker reset to default when replying to an issue email (#7197).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4575 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/mail_handler.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index 00010059f..4b6b4a402 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -256,8 +256,8 @@ class MailHandler < ActionMailer::Base assigned_to = (k = get_keyword(:assigned_to, :override => true)) && find_user_from_keyword(k) assigned_to = nil if assigned_to && !issue.assignable_users.include?(assigned_to) - { - 'tracker_id' => ((k = get_keyword(:tracker)) && issue.project.trackers.find_by_name(k).try(:id)) || issue.project.trackers.find(:first).try(:id), + attrs = { + 'tracker_id' => (k = get_keyword(:tracker)) && issue.project.trackers.find_by_name(k).try(:id), 'status_id' => (k = get_keyword(:status)) && IssueStatus.find_by_name(k).try(:id), 'priority_id' => (k = get_keyword(:priority)) && IssuePriority.find_by_name(k).try(:id), 'category_id' => (k = get_keyword(:category)) && issue.project.issue_categories.find_by_name(k).try(:id), @@ -268,6 +268,12 @@ class MailHandler < ActionMailer::Base 'estimated_hours' => get_keyword(:estimated_hours, :override => true), 'done_ratio' => get_keyword(:done_ratio, :override => true, :format => '(\d|10)?0') }.delete_if {|k, v| v.blank? } + + if issue.new_record? && attrs['tracker_id'].nil? + attrs['tracker_id'] = issue.project.trackers.find(:first).try(:id) + end + + attrs end # Returns a Hash of issue custom field values extracted from keywords in the email body |