プロジェクト

全般

プロフィール

Vote #80503

未完了

Incoming mails handled by MailHandler sometimes logs with the wrong locale

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

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

0%

予定工数:
category_id:
29
version_id:
0
issue_org_id:
32518
author_id:
90398
assigned_to_id:
0
comments:
1
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
153
ステータス-->[New]

説明

It happens from time to time that MailHandler logs errors related to incoming email messages
with the wrong locale (for instance in Japanese while my system is set to English by default).

For instance:
Nov 26 08:20:33 [ERROR] MailHandler: Validation failed: 类别 不能为空字符, 计划完成日期 不能为空字符, 预期时
Instead of:
Nov 26 16:18:02 [ERROR] MailHandler: Validation failed: Assignee cannot be blank, Category cannot be blank, Due date cannot be blank, Estimated time cannot be blank

I think this might be due to the locale leaking from previous unrelated requests, as
explained in e.g.:
https://edgeguides.rubyonrails.org/i18n.html#managing-the-locale-across-requests

Here is a tiny patch (agains 4.0.5) that explcitly sets the locale to English, since most of
the error messages printed in MailHandler are in English already. I set the locale just
before calling 'dispatch', as this is 'dispatch' that can actually make use of the locale.
But I guess it could be set anywhere that makes sense.


journals

A precision: the users that trigger this wrong locale for sure do not have their own language or anything set to Japanese.
They typically use English.

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

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

いいね!0
いいね!0