Defect #36444

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

Added by Go MAEDA 9 months ago. Updated about 4 hours ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Email receiving
Target version:Candidate for next major release
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.

History

#1 Updated by Go MAEDA 9 months 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

#2 Updated by Go MAEDA 9 months 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

#3 Updated by Marius BALTEANU about 4 hours ago

  • Target version set to Candidate for next major release

Also available in: Atom PDF