Patch #20535

CSV importer raises I18n::InvalidLocale exception if current user's language is "(auto)"

Added by Go MAEDA over 2 years ago. Updated over 2 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Importers
Target version:-

Description

CSV importer inplemented in r14493 raises I18n::InvalidLocale exception after uploading CSV file if if current user's language selection is "(auto)".

This is probably caused by source:trunk/lib/redmine/i18n.rb@14493#L63.

lang = user.try(:language) || Setting.default_language

User#language returns "" (zero length string) when the users's language setting is "(auto)".
I think current_language method should be called instead of language method.

csv_import_error_when_language_is_auto.diff Magnifier (440 Bytes) Go MAEDA, 2015-08-15 03:24

Associated revisions

Revision 14504
Added by Jean-Philippe Lang over 2 years ago

CSV importer raises I18n::InvalidLocale exception if current user's language is "(auto)" (#905, #20535).

History

#1 Updated by Jean-Philippe Lang over 2 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang

#current_language returns the current I18n locale and does not depend on user. A simple #presence fixed this error r14504.
Thanks for pointing this out.

Also available in: Atom PDF