Defect #33521

Use issue path instead of bulk update issues path when using the context menu with only one issue selected

Added by Marius BALTEANU over 1 year ago. Updated 3 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Marius BALTEANU% Done:

0%

Category:Issues
Target version:5.0.0
Resolution:Fixed Affected version:

Description

When changing the attributes of an issue from the context menu, the bulk update issues path is used even if only one issue is selected. Because of this, if the validation fails, the user is redirect to the bulk edit view to fill in the required fields. But if Description is one of those fields, the user won't have available the field because Description is not available in the bulk edit view.

The attach patch changes the behaviour in order to use issue path to update attributes when only one issue is selected. In this case, if the validation fails, the user is redirect to the issue edit page. The route change was necessary in order to allow Patch method for bulk routes as well.

0001-Use-issue_path-when-only-one-issue-is-modified-from-.patch Magnifier (12.6 KB) Marius BALTEANU, 2020-05-28 17:44

0001-Use-issue-path-instead-of-bulk-update-issues-path-wh.patch Magnifier (12.3 KB) Marius BALTEANU, 2021-07-04 17:31

0002-Change-custom-field-value-update-path-on-the-context.patch Magnifier (5.63 KB) Mizuki ISHIKAWA, 2021-08-02 04:34

0001-Fix-status-update-path-on-the-context-menu.patch Magnifier (4.49 KB) Mizuki ISHIKAWA, 2021-08-02 04:34

diff.patch Magnifier (3.13 KB) Mizuki ISHIKAWA, 2021-08-04 10:49

Associated revisions

Revision 21089
Added by Marius BALTEANU 3 months ago

Use issue path instead of bulk update issues path when only one issue is selected in the context menu (#33521).

Revision 21132
Added by Marius BALTEANU 3 months ago

Fix update status path on the context menu (#33521).

Patch by Mizuki ISHIKAWA.

Revision 21133
Added by Marius BALTEANU 3 months ago

Update custom field path on the context menu (#33521).

Patch by Mizuki ISHIKAWA.

Revision 21139
Added by Marius BALTEANU 3 months ago

Fix that updating an issue from context menu to a none value do not set the field to blank (#33521).

Patch by Mizuki ISHIKAWA.

Revision 21140
Added by Marius BALTEANU 3 months ago

Fix typo (#33521).

History

#2 Updated by Go MAEDA over 1 year ago

Would you tell me the steps to cause a validation error through the context menu? Since the context menu only shows valid options, I could not find a way to cause a validation error.

#3 Updated by Marius BALTEANU over 1 year ago

Go MAEDA wrote:

Would you tell me the steps to cause a validation error through the context menu? Since the context menu only shows valid options, I could not find a way to cause a validation error.

Yes, please follow these steps using the default data:
  1. Make "Description" field mandatory for "In progress" status
  2. Find an issue in status "New" without "Description" filled in
  3. Using the context menu, try to change the issue status to in "In progress"
  4. You should receive the validation error and you can observe that the Description field is not available in the page.

#4 Updated by Go MAEDA over 1 year ago

Marius BALTEANU wrote:

Go MAEDA wrote:

Would you tell me the steps to cause a validation error through the context menu? Since the context menu only shows valid options, I could not find a way to cause a validation error.

Yes, please follow these steps using the default data:
  1. Make "Description" field mandatory for "In progress" status
  2. Find an issue in status "New" without "Description" filled in
  3. Using the context menu, try to change the issue status to in "In progress"
  4. You should receive the validation error and you can observe that the Description field is not available in the page.

Thank you, confirmed the issue.

#5 Updated by Marius BALTEANU about 1 year ago

  • Target version changed from Candidate for next major release to 4.2.0

#6 Updated by Marius BALTEANU 7 months ago

  • Tracker changed from Patch to Defect
  • Status changed from New to Confirmed
  • Target version changed from 4.2.0 to 5.0.0

#8 Updated by Marius BALTEANU 3 months ago

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

Patch committed.

#9 Updated by Go MAEDA 3 months ago

  • Status changed from Closed to Reopened

Due to r21089, you are no longer able to change the issue status via the context menu. The error is as follows:

Started POST "/issues/1?back_url=%2Fprojects%2Fecookbook%2Fissues&ids%5B%5D=1&issue%5Bstatus_id%5D=5" for 127.0.0.1 at 2021-08-02 09:55:03 +0900

ActionController::RoutingError (No route matches [POST] "/issues/1"):

#10 Updated by Mizuki ISHIKAWA 3 months ago

I have attached two patches.

  • 0001-Fix-status-update-path-on-the-context-menu.patch
    The cause of #33521#note-9 is that the data method of the link to update the status was still post instead of patch.
    This is a patch that adds data-method fixes and tests.

#11 Updated by Marius BALTEANU 3 months ago

  • Status changed from Reopened to Closed
  • Assignee set to Marius BALTEANU

Both patches committed, thank you for working on this.

#12 Updated by Mizuki ISHIKAWA 3 months ago

I found another problem caused by the impact of this change.

When changing the category to none from the context menu:
[Expected result] "Category deleted (Printing)" is displayed in the issue history.
[Actual result] "Category changed from Printing to 0" is displayed in the issue history.

This can be reproduced with attributes other than category_id.

When I pass the parameter {category_id:'none'}, bulk_update converts it to {category_id:''} by the parse_params_for_bulk_update method, but update doesn't.
https://redmine.org/projects/redmine/repository/revisions/21012/entry/trunk/app/controllers/application_controller.rb#L416

#13 Updated by Marius BALTEANU 3 months ago

  • Status changed from Closed to Reopened

#14 Updated by Mizuki ISHIKAWA 3 months ago

I have attached a patch to fix #33521#note-12.

#15 Updated by Marius BALTEANU 3 months ago

  • Status changed from Reopened to Closed

Mizuki ISHIKAWA wrote:

I have attached a patch to fix #33521#note-12.

Patch committed with small changes, thank you for reporting and fixing the issue.

#16 Updated by Mizuki ISHIKAWA 3 months ago

Marius BALTEANU wrote:

Mizuki ISHIKAWA wrote:

I have attached a patch to fix #33521#note-12.

Patch committed with small changes, thank you for reporting and fixing the issue.

Thank you for reviewing and committing.

Also available in: Atom PDF