From e69249a36e6cab8534417359e8f9e67ed8a6ac83 Mon Sep 17 00:00:00 2001 From: Alexandr Date: Wed, 27 Nov 2019 12:38:01 +0300 Subject: [PATCH] Update mail_handler_patch.rb Fix issue #144 - incorrect issue and project ids usage --- lib/mail_handler_patch.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mail_handler_patch.rb b/lib/mail_handler_patch.rb index ab7d3e3..d6ab4f2 100644 --- a/lib/mail_handler_patch.rb +++ b/lib/mail_handler_patch.rb @@ -30,7 +30,7 @@ def dispatch_to_default_with_helpdesk sender_email = @email.from.first # any cc handling needed? - custom_value = custom_field_value(issue,'cc-handling') + custom_value = custom_field_value(issue.project,'cc-handling') if (!@email.cc.nil?) && (custom_value.value == '1') carbon_copy = @email[:cc].formatted.join(', ') custom_value = custom_field_value(issue,'copy-to') @@ -115,7 +115,7 @@ def receive_issue_reply_with_helpdesk(issue_id, from_journal=nil) def custom_field_value(issue,name) custom_field = CustomField.find_by_name(name) CustomValue.where( - "customized_id = ? AND custom_field_id = ?", issue.project.id, custom_field.id + "customized_id = ? AND custom_field_id = ?", issue.id, custom_field.id ).first end