Project

General

Profile

Actions

Defect #36444

open

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

Added by Go MAEDA almost 3 years ago. Updated about 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Email receiving
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

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.

Actions #1

Updated by Go MAEDA almost 3 years ago

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

Validation failed: Tracker cannot be blank, Status cannot be blank, No tracker is associated to this project. Please check the Project settings.
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
Actions #2

Updated by Go MAEDA almost 3 years ago

  • Subject changed from The error message when no trackers are assigned to a project is confusing to Validation error message when no trackers are assigned to a project is confusing
Actions #3

Updated by Marius BÄ‚LTEANU about 2 years ago

  • Target version set to Candidate for next major release
Actions

Also available in: Atom PDF