Actions
Defect #7197
closedTracker reset to default when replying to an issue email
Start date:
2010-12-29
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
When replying to an issue email with no explicit tracker set either in the mail body or in the CLI defaults, replying to an issue per mail reverts the tracker of the issue to the "default" tracker (first tracker in list). This is caused by source:/trunk/app/models/mail_handler.rb#L260 and was introduced in r4394.
Related issues
Updated by Felix Schäfer almost 14 years ago
This moves setting the default tracker in the email receiving method:
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index 8925e4e..43eaf68 100644
--- a/app/models/mail_handler.rb
+++ b/app/models/mail_handler.rb
@@ -125,6 +125,7 @@ class MailHandler < ActionMailer::Base
issue = Issue.new(:author => user, :project => project)
issue.safe_attributes = issue_attributes_from_keywords(issue)
issue.safe_attributes = {'custom_field_values' => custom_field_values_from_keywords(issue)}
+ issue.tracker ||= issue.project.trackers.find(:first)
issue.subject = email.subject.to_s.chomp[0,255]
if issue.subject.blank?
issue.subject = '(no subject)'
@@ -260,7 +261,7 @@ class MailHandler < ActionMailer::Base
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
+ '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),
Updated by Jean-Philippe Lang almost 14 years ago
- Status changed from New to Closed
Actions