Project

General

Profile

Actions

Defect #40860

closed

Creating a new issue fails with an internal error if no issue priorities are defined

Added by Holger Just 5 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Issues
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

If no issue priority is defined, creating an issue using issue#create fails with the following error:

NoMethodError (undefined method `id' for nil:NilClass):

app/models/issue.rb:2075:in `clear_disabled_fields'
app/controllers/issues_controller.rb:153:in `create'
lib/redmine/sudo_mode.rb:78:in `sudo_mode'

This can be fixed with the attached patch which results in a proper error message to be shown to the user:

Priority cannot be blank

Unfortunately, this message is still shown even if the priority field is disabled for a tracker (as we still have to set a priority here, see #38416).

This may be acceptable as a uncommon special case though. If this shall be changed, we might handle this similar to the check for a defined tracker and default status in IssueController#build_new_issue_from_params.


Files

issue_priorities.diff (514 Bytes) issue_priorities.diff Holger Just, 2024-06-19 18:17
test-for-40860.patch (751 Bytes) test-for-40860.patch Go MAEDA, 2024-06-20 13:39

Related issues

Related to Redmine - Feature #38416: Ability to disable the priority fieldClosedGo MAEDA

Actions
Has duplicate Redmine - Patch #40194: Fix error in clear_disabled_fields method when IssuePriority is missingClosed

Actions
Actions

Also available in: Atom PDF