Defect #35606

Locked users should not be displayed in the members box of the project overview page

Added by Go MAEDA 2 months ago. Updated 2 months ago.

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

0%

Category:Projects
Target version:4.2.2
Resolution:Fixed Affected version:4.2.1

Description

Before Redmine 4.2.0, members box of the project overview page did not display locked users, but it does in Redmine 4.2.0.

I think it is a bug due to #33174. In the change, the method to list members has been changed from Project#members to Project#memberships to get not only users but also groups. However, Project#members only returns active users but Project#memberships does not check the status of users/groups.

  has_many :memberships, :class_name => 'Member', :inverse_of => :project
  # Memberships of active users only
  has_many :members,
           lambda {joins(:principal).where(:users => {:type => 'User', :status => Principal::STATUS_ACTIVE})}

I think Project#principals_by_role that prepares values for the members box by using Project#memberships should exclude locked users.

Redmine 4.1:

Redmine 4.2:

4_1.png (209 KB) Go MAEDA, 2021-07-26 11:33

4_2.png (294 KB) Go MAEDA, 2021-07-26 11:33

fix-35606.patch Magnifier (1.3 KB) Mizuki ISHIKAWA, 2021-07-27 04:52

Associated revisions

Revision 21090
Added by Go MAEDA 2 months ago

Locked users should not be displayed in the members box of the project overview page (#35606).

Patch by Mizuki ISHIKAWA.

Revision 21091
Added by Go MAEDA 2 months ago

Merged r21090 from trunk to 4.2-stable (#35606).

Revision 21099
Added by Go MAEDA 2 months ago

Remove unnecessary comments (#35606).

Revision 21100
Added by Go MAEDA 2 months ago

Merged r21099 from trunk to 4.2-stable (#35606).

History

#1 Updated by Go MAEDA 2 months ago

  • Target version set to 4.2.2
  • Affected version set to 4.2.1

Although a patch is not yet ready, it should be fixed as soon as possible. Setting the target version to 4.2.2.

#2 Updated by Mizuki ISHIKAWA 2 months ago

Fix to show only active users or groups.

#3 Updated by Go MAEDA 2 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the fix. Thank you.

Also available in: Atom PDF