Vote #81338
完了Cannot change the default version and default assignee under settings
0%
説明
Cannot change the default version under settings
Project -> Settings -> Issue Tracking -> Default Version
!bug-cannot-change-default-version.png!
The bug found with v4.1, v4.2 and the master branch, can you verify this bug?
Thanks!
journals
I cannot reproduce the issue on my production system. Please make sure that the not shown versions are neither locked nor closed.
--------------------------------------------------------------------------------
Hi Bernhard,
Thanks for your quick response, I checked out the latest 4.2-stable branch from github, the problem persists, the versions are neither closed or locked, see screenshot below
!versions.png!
I checked the production.log, it seems no error? I cannot change the default version v0.2 to any others, logs below, you can see the default_version_id was passed to ruby, but nothing changed to the database.
<pre>
Started PATCH "/projects/fund" for 192.168.5.63 at 2021-03-30 18:16:49 +0800
Processing by ProjectsController#update as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"TOKEN_REMOVED", "tab"=>"issues", "project"=>{"tracker_ids"=>["4", "1", "2", "5", "3", ""]}, "project_issue_tracking"=>{"default_version_id"=>"1", "default_assigned_to_id"=>""}, "commit"=>"Save", "id"=>"fund"}
Current user: swei (id=5)
Redirected to http://172.16.200.203/projects/fund/settings/issues
Completed 302 Found in 25ms (ActiveRecord: 7.6ms)
Started GET "/projects/fund/settings/issues" for 192.168.5.63 at 2021-03-30 18:16:49 +0800
Processing by ProjectsController#settings as HTML
Parameters: {"id"=>"fund", "tab"=>"issues"}
Current user: swei (id=5)
Rendering projects/settings.html.erb within layouts/base
Rendered projects/_form.html.erb (15.1ms)
Rendered projects/_edit.html.erb (16.3ms)
Rendered projects/settings/_members.html.erb (12.0ms)
Rendered projects/settings/_issues.html.erb (13.5ms)
Rendered projects/settings/_versions.html.erb (8.6ms)
Rendered projects/settings/_issue_categories.html.erb (2.8ms)
Rendered projects/settings/_repositories.html.erb (6.4ms)
Rendered projects/settings/_activities.html.erb (11.2ms)
Rendered common/_tabs.html.erb (74.3ms)
Rendered projects/settings.html.erb within layouts/base (76.3ms)
Completed 200 OK in 117ms (Views: 74.5ms | ActiveRecord: 31.5ms)
Started PATCH "/projects/fund" for 192.168.5.63 at 2021-03-30 18:17:40 +0800
Processing by ProjectsController#update as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"TOKEN_REMOVED", "tab"=>"issues", "project"=>{"tracker_ids"=>["4", "1", "2", "5", "3", ""]}, "project_issue_tracking"=>{"default_version_id"=>"8", "default_assigned_to_id"=>""}, "commit"=>"Save", "id"=>"fund"}
Current user: swei (id=5)
Redirected to http://172.16.200.203/projects/fund/settings/issues
Completed 302 Found in 38ms (ActiveRecord: 11.8ms)
Started GET "/projects/fund/settings/issues" for 192.168.5.63 at 2021-03-30 18:17:40 +0800
Processing by ProjectsController#settings as HTML
Parameters: {"id"=>"fund", "tab"=>"issues"}
Current user: swei (id=5)
Rendering projects/settings.html.erb within layouts/base
Rendered projects/_form.html.erb (18.7ms)
Rendered projects/_edit.html.erb (20.5ms)
Rendered projects/settings/_members.html.erb (15.1ms)
Rendered projects/settings/_issues.html.erb (11.6ms)
Rendered projects/settings/_versions.html.erb (8.5ms)
Rendered projects/settings/_issue_categories.html.erb (3.0ms)
Rendered projects/settings/_repositories.html.erb (8.0ms)
Rendered projects/settings/_activities.html.erb (13.2ms)
Rendered common/_tabs.html.erb (85.5ms)
Rendered projects/settings.html.erb within layouts/base (88.4ms)
Completed 200 OK in 129ms (Views: 93.1ms | ActiveRecord: 24.9ms)
</pre>
--------------------------------------------------------------------------------
Yes, you are right. I've tested it again.
The issue is not that the versions are not shown but that it flips back to its prior value if you click the save button.
--------------------------------------------------------------------------------
The issue is caused by r20766 which was done for #34032. The form parameter (project_issue_tracking) was changed without processing it in the controller.
The other values for custom fields and trackers are set correctly as the name of their input fields is hard coded in this view.
> Started PATCH "/projects/ecookbook" for 127.0.0.1 at 2021-03-30 16:15:05 +0200
> Processing by ProjectsController#update as HTML
> Parameters: {"utf8"=>"✓", "authenticity_token"=>"rLc3tuqdXLulwVWSOqG0OhFdFyMT13ycZWYXRpWU2ggMIjQT1sN5KdG3eGp21rx81_LtHLSBg2Z46tSgEm2E9g", "tab"=>"issues", "project"=>{"tracker_ids"=>["1", "2", "3", ""], "issue
> _custom_field_ids"=>["9", ""]}, "project_issue_tracking"=>{"default_version_id"=>"3", "default_assigned_to_id"=>"3"}, "commit"=>"Save", "id"=>"ecookbook"}
At the moment I don't know what's the best way to fix it. Reverting the patch or modifying the controller to additionally save the values of the second parameter. The last seems to be the cleaner option to me.
@GoMAEDA, @MariusBALTEANU I posted this comment accidentially in #34988.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
I've attached a fix with tests included.
--------------------------------------------------------------------------------
The patch verified and the defect was FIXED, thanks for your guys quick & selfless contributions!
--------------------------------------------------------------------------------
I've checked/tested the patch, too. I can confirm that it fixes the issue.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Committed the fix. Thank you.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
related_issues
relates,Closed,34032,Project settings tab contains two items with the same id
duplicates,Closed,35056,Can't save "Default assignee" user for project.
duplicates,Closed,35400,The default version setting is invalid