From: Jean-Philippe Lang Date: Mon, 10 Jan 2011 19:57:41 +0000 (+0000) Subject: Fixed MailHandler broken by I18n fallback added in r4679. X-Git-Tag: 1.2.0~1100 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7b7577c747ce9bf7b8289aa4f7c1884ceb74767f;p=redmine.git Fixed MailHandler broken by I18n fallback added in r4679. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4682 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index 617f0ee11..1410a6091 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -235,8 +235,8 @@ class MailHandler < ActionMailer::Base def extract_keyword!(text, attr, format=nil) keys = [attr.to_s.humanize] if attr.is_a?(Symbol) - keys << l("field_#{attr}", :default => '', :locale => user.language) if user - keys << l("field_#{attr}", :default => '', :locale => Setting.default_language) + keys << l("field_#{attr}", :default => '', :locale => user.language) if user && user.language.present? + keys << l("field_#{attr}", :default => '', :locale => Setting.default_language) if Setting.default_language.present? end keys.reject! {|k| k.blank?} keys.collect! {|k| Regexp.escape(k)}