Defect #33733
closed
No trackers are selected for new projects
Added by Yuichi HARADA over 4 years ago.
Updated almost 4 years ago.
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
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
- Status changed from New to Confirmed
- Assignee set to Jean-Philippe Lang
- Target version set to 4.2.0
I assigned this issue to Jean-Philippe Lang because the patch introduces a bit bigger behavior change that changes the existing test.
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.
- Assignee changed from Jean-Philippe Lang to Yuichi HARADA
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
- Assignee changed from Yuichi HARADA to Go MAEDA
- 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.
Also available in: Atom
PDF