プロジェクト

全般

プロフィール

Vote #68875

完了

Apply CLI-supplied defaults for incoming mail only to new issues not replies

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Email receiving_29
対象バージョン:
開始日:
2010/12/29
期日:
進捗率:

0%

予定工数:
category_id:
29
version_id:
20
issue_org_id:
7195
author_id:
3866
assigned_to_id:
0
comments:
4
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Replying to an issue mail used to ignore default parameters passed to the mail-handling rake task, or to be precise did only care for other parameters than those we pass on the command line. The refactorings in r4394 changed that though, and now replies to "issue mails" re-apply the defaults passed on the CLI, which I don't think is something that should happen.

Example:

Create a new issue, say in the tracker "Bug"

Write a reply to the mail you just got for that issue, the mail gets imported with: @rake redmine:email:receive_imap … tracker=Support@

The tracker of the issue gets changed to "Support"


journals

The following fix is not elegant but does the job:

<pre><code class="diff">diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index 8925e4e..1aa3ff9 100644
--- a/app/models/mail_handler.rb
+++ b/app/models/mail_handler.rb
@@ -150,6 +150,9 @@ class MailHandler < ActionMailer::Base
unless @@handler_options[:no_permission_check]
raise UnauthorizedAction unless user.allowed_to?(:add_issue_notes, issue.project) || user.allowed_to?(:edit_issues, issue.project)
end
+
+ # ignore CLI-supplied defaults for new issues
+ @@handler_options[:issue].clear

journal = issue.init_journal(user, cleaned_up_text_body)
issue.safe_attributes = issue_attributes_from_keywords(issue)</code><pre>
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Fixed with test in r4576.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,Closed,30070,Unable to update assignee with rdm-mailhandler.rb

Admin Redmine さんが約4年前に更新

  • カテゴリEmail receiving_29 にセット
  • 対象バージョン1.1.0_20 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0