Defect #33733

Tracker does not work after creating a new project

Added by Yuichi HARADA about 1 month ago. Updated about 1 month ago.

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

0%

Category:Projects
Target version:4.2.0
Resolution: Affected version:

Description

Immediately after installing Redmine, the initial display of the trackers on Administration > Settings > Projects > [Default trackers for new projects] is unchecked.

However, even if the screen display is the same, the behavior is different immediately after installing Redmine and after saving.
  • Immediately after installing Redmine:
    All trackers are enabled when you create a new project.
  • After saving on Administration > Settings > Projects (trackers remains checked off):
    All trackers are disabled when you create a new project.

administration-settings-projects.png (169 KB) Yuichi HARADA, 2020-07-15 07:26

fix-33733.patch Magnifier (1.13 KB) Yuichi HARADA, 2020-07-15 07:38

History

#1 Updated by Yuichi HARADA about 1 month ago

The following patch will solve the problem.

diff --git a/app/models/project.rb b/app/models/project.rb
index 0119b1228..aba2ef4b5 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -122,7 +122,7 @@ class Project < ActiveRecord::Base
       self.enabled_module_names = Setting.default_projects_modules
     end
     if !initialized.key?('trackers') && !initialized.key?('tracker_ids')
-      default = Setting.default_projects_tracker_ids
+      default = Setting.default_projects_tracker_ids.presence
       if default.is_a?(Array)
         self.trackers = Tracker.where(:id => default.map(&:to_i)).sorted.to_a
       else

#2 Updated by Go MAEDA about 1 month ago

  • Status changed from New to Confirmed
  • Assignee set to Jean-Philippe Lang
  • Target version set to 4.2.0

#3 Updated by Go MAEDA about 1 month ago

I assigned this issue to Jean-Philippe Lang because the patch introduces a bit bigger behavior change that changes the existing test.

Also available in: Atom PDF