Vote #80971
完了No trackers are selected for new projects
0%
説明
Immediately after installing Redmine, the initial display of the trackers on Administration > Settings > Projects > [Default trackers for new projects] is unchecked.
!{width:400px;border:1px solid #ccc;}administration-settings-projects.png!
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.
journals
The following patch will solve the problem.
<pre><code class="diff">
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
</code></pre>
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
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.
<pre>
$ bundle exec rake db:migrate:reset
$ bundle exec rake redmine:load_default_data
</pre>
!{width:400px;border:1px solid grey;}apply-patch.png!
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Committed the fix. Thank you.
--------------------------------------------------------------------------------