Project

General

Profile

Actions

Defect #38443

closed

Cannot add a user to a group if the group is a member without roles in a certain project

Added by Go MAEDA over 1 year ago. Updated over 1 year ago.

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

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

An exception will be raised if you attempt to add a user to a group if the group is a member without any roles in a certain project. The attempt will fail with the following error.

Completed 422 Unprocessable Entity in 36ms (ActiveRecord: 14.5ms | Allocations: 14551)

ActiveRecord::RecordInvalid (Validation failed: Role cannot be empty):

app/models/group.rb:90:in `block in user_added'
app/models/group.rb:81:in `user_added'
app/controllers/groups_controller.rb:118:in `add_users'
lib/redmine/sudo_mode.rb:61:in `sudo_mode

You can reproduce the error with the following steps:

1. Add a group as a project member with any role
2. Edit the member and clear checkboxes for all roles and save
3. Go to Administration > Groups
4. Add a user to the group. You cannot add a group. The above error will be logged


Files

38443.patch (1.17 KB) 38443.patch Go MAEDA, 2023-04-12 16:27

Related issues

Related to Redmine - Defect #37166: Roles of a project member should not be made emptyClosedGo MAEDA

Actions
Actions

Also available in: Atom PDF