プロジェクト

全般

プロフィール

Vote #81785

未完了

Validation error message when no trackers are assigned to a project is confusing

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

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

0%

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

説明

Assume that you are trying to create an issue via email. If no tracker is associated to the target project, the issue creation will fail and you will see a validation error in production.log as follows.

MailHandler: Validation failed: Validation failed: Tracker cannot be blank, Status cannot be blank

Probably it is difficult for most users to understand that the cause of the error is that no tracker is assigned to the project by seeing the error above. I think the error message needs some improvement.


journals

The following change improves the validation error message. After applying it, the error message will be like this:

<pre>
Validation failed: Tracker cannot be blank, Status cannot be blank, No tracker is associated to this project. Please check the Project settings.
</pre>

<pre><code class="diff">
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 02aaff33b..8cc1ad66e 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -798,6 +798,11 @@ class Issue < ActiveRecord::Base
end
end
end
+
+ # Checks the project has associated trackers
+ if project && project.trackers.empty?
+ errors.add :base, I18n.t(:error_no_tracker_in_project)
+ end
end

# Validates the issue against additional workflow requirements
</code></pre>
--------------------------------------------------------------------------------

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

Admin Redmine さんが3年以上前に更新

  • カテゴリEmail receiving_29 にセット

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

いいね!0
いいね!0