Defect #7197
closed
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),
- Target version set to 1.1.0
Fixed with test in r4575.
- Status changed from New to Closed
Also available in: Atom
PDF