Project

General

Profile

Actions

Defect #33733

closed

No trackers are selected for new projects

Added by Yuichi HARADA almost 4 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Projects
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
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.

Files

administration-settings-projects.png (169 KB) administration-settings-projects.png Yuichi HARADA, 2020-07-15 07:26
fix-33733.patch (1.13 KB) fix-33733.patch Yuichi HARADA, 2020-07-15 07:38
patch-33733.patch (1.61 KB) patch-33733.patch Marius BĂLTEANU, 2021-03-18 22:50
apply-patch.png (28 KB) apply-patch.png Yuichi HARADA, 2021-03-23 03:01
Actions #1

Updated by Yuichi HARADA almost 4 years 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
Actions #2

Updated by Go MAEDA almost 4 years ago

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

Updated by Go MAEDA almost 4 years ago

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

Actions #4

Updated by Marius BĂLTEANU about 3 years ago

Default trackers are not part of the default Redmine settings (settings.yml), are part of the default data which is not necessary applied on all new instances.

From my point of view, to fix this, we should add Setting.default_projects_tracker_ids as part of the default data (when the trackers are added). Please try with the attached patch and let me know what do you think.

Actions #5

Updated by Marius BĂLTEANU about 3 years ago

  • Assignee changed from Jean-Philippe Lang to Yuichi HARADA
Actions #6

Updated by Yuichi HARADA about 3 years ago

Marius BALTEANU wrote:

Default trackers are not part of the default Redmine settings (settings.yml), are part of the default data which is not necessary applied on all new instances.

From my point of view, to fix this, we should add Setting.default_projects_tracker_ids as part of the default data (when the trackers are added). Please try with the attached patch and let me know what do you think.

Thank you for creating the patch.

Comfirmed the your patch. I think the patch is good.
When I imported the default data as follows, "Default trackers for new projects" were properly checked on.

$ bundle exec rake db:migrate:reset
$ bundle exec rake redmine:load_default_data

Actions #7

Updated by Marius BĂLTEANU about 3 years ago

  • Assignee changed from Yuichi HARADA to Go MAEDA
Actions #8

Updated by Go MAEDA about 3 years ago

  • Subject changed from Tracker does not work after creating a new project to No trackers are selected for new projects
  • Status changed from Confirmed to Closed
  • Resolution set to Fixed

Committed the fix. Thank you.

Actions

Also available in: Atom PDF