Defect #33733
closedNo trackers are selected for new projects
0%
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
Updated by Yuichi HARADA over 4 years ago
- File fix-33733.patch fix-33733.patch added
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
Updated by Go MAEDA over 4 years ago
- Status changed from New to Confirmed
- Assignee set to Jean-Philippe Lang
- Target version set to 4.2.0
Updated by Go MAEDA over 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.
Updated by Marius BĂLTEANU almost 4 years ago
- File patch-33733.patch patch-33733.patch added
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.
Updated by Marius BĂLTEANU almost 4 years ago
- Assignee changed from Jean-Philippe Lang to Yuichi HARADA
Updated by Yuichi HARADA almost 4 years ago
- File apply-patch.png apply-patch.png added
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
Updated by Marius BĂLTEANU almost 4 years ago
- Assignee changed from Yuichi HARADA to Go MAEDA
Updated by Go MAEDA almost 4 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.