Actions
Defect #40860
closedCreating a new issue fails with an internal error if no issue priorities are defined
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
Related issues
Updated by Holger Just 6 months ago
See
for the original description of this issue.Updated by Go MAEDA 6 months ago
- Related to Feature #38416: Ability to disable the priority field added
Updated by Go MAEDA 6 months ago
- File test-for-40860.patch test-for-40860.patch added
- Target version changed from 5.0.10 to 5.1.4
I wrote a test for the fix.
Updated by Go MAEDA 6 months ago
- Subject changed from Creating a new issue fails with an internal eror if no issue priorities are defined to Creating a new issue fails with an internal error if no issue priorities are defined
- Status changed from New to Resolved
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the fix in r22895. Thank you.
Updated by Go MAEDA about 1 month ago
- Has duplicate Patch #40194: Fix error in clear_disabled_fields method when IssuePriority is missing added
Actions