Patch #38064

Avoid exception when adding a project without any givable roles defined

Added by Holger Just about 1 month ago. Updated about 1 month ago.

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

0%

Category:Project settings
Target version:4.2.10

Description

Project.default_member_role might return nil if there is no default member role and no givable role at all.

In the safe_attribute definition of Project#enabled_module_names, we use the method's return value without checking this. The attached patch fixes this by using the safe navigation operator there (introduced in Ruby 2.3.0) and denying changing of the modules if the user is not an admin.

0001-Do-not-break-when-setting-enabled_module_names-on-a-.patch Magnifier (846 Bytes) Holger Just, 2022-12-19 21:05

Associated revisions

Revision 21994
Added by Go MAEDA about 1 month ago

Do not break when setting enabled_module_names on a project without a default_member_role (#38064).

Patch by Holger Just.

Revision 21995
Added by Go MAEDA about 1 month ago

Merged r21994 from trunk to 5.0-stable (#38064).

Revision 21996
Added by Go MAEDA about 1 month ago

Merged r21994 from trunk to 4.2-stable (#38064).

History

#1 Updated by Go MAEDA about 1 month ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version changed from Candidate for next minor release to 4.2.10

Committed the patch. Thank you.

Also available in: Atom PDF