Defect #34982

Cannot change the default version and default assignee under settings

Added by Sunding Wei 13 days ago. Updated 3 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Issues
Target version:4.2.1
Resolution:Fixed Affected version:4.2.0

Description

Cannot change the default version under settings

Project -> Settings -> Issue Tracking -> Default Version

The bug found with v4.1, v4.2 and the master branch, can you verify this bug?

Thanks!

bug-cannot-change-default-version.png (16.6 KB) Sunding Wei, 2021-03-30 08:42

versions.png (17.2 KB) Sunding Wei, 2021-03-30 12:20

0001-Fix-cannot-change-the-default-version-under-settings.patch Magnifier (2 KB) Marius BALTEANU, 2021-03-30 17:53


Related issues

Related to Redmine - Defect #34032: Project settings tab contains two items with the same id Closed
Duplicated by Redmine - Defect #35056: Can't save "Default assignee" user for project. Closed

Associated revisions

Revision 20875
Added by Go MAEDA 12 days ago

Fix cannot change the default version under settings (#34982).

Patch by Marius BALTEANU.

Revision 20876
Added by Go MAEDA 12 days ago

Merged r20875 from trunk to 4.2-stable (#34982).

History

#1 Updated by Bernhard Rohloff 13 days ago

  • Category set to Issues
  • Status changed from New to Needs feedback

I cannot reproduce the issue on my production system. Please make sure that the not shown versions are neither locked nor closed.

#2 Updated by Sunding Wei 13 days ago

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

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.

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)

#3 Updated by Bernhard Rohloff 13 days ago

  • Status changed from Needs feedback to Confirmed

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.

#4 Updated by Bernhard Rohloff 12 days ago

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.

#5 Updated by Marius BALTEANU 12 days ago

  • Assignee set to Marius BALTEANU
  • Target version set to 4.2.1

#6 Updated by Marius BALTEANU 12 days ago

  • Related to Defect #34032: Project settings tab contains two items with the same id added

#8 Updated by Marius BALTEANU 12 days ago

I've attached a fix with tests included.

#9 Updated by Sunding Wei 12 days ago

The patch verified and the defect was FIXED, thanks for your guys quick & selfless contributions!

#10 Updated by Bernhard Rohloff 12 days ago

I've checked/tested the patch, too. I can confirm that it fixes the issue.

#11 Updated by Marius BALTEANU 12 days ago

  • Assignee changed from Marius BALTEANU to Go MAEDA

#12 Updated by Go MAEDA 12 days ago

  • Status changed from Confirmed to Resolved
  • Resolution set to Fixed

Committed the fix. Thank you.

#13 Updated by Go MAEDA 12 days ago

  • Status changed from Resolved to Closed

#14 Updated by Marius BALTEANU 4 days ago

  • Subject changed from Cannot change the default version under settings to Cannot change the default version and assignee under settings

#15 Updated by Marius BALTEANU 3 days ago

  • Subject changed from Cannot change the default version and assignee under settings to Cannot change the default version and default assignee under settings

#16 Updated by Marius BALTEANU 3 days ago

  • Duplicated by Defect #35056: Can't save "Default assignee" user for project. added

Also available in: Atom PDF