Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add users into protected branch list #823

Open
tomhub opened this issue Feb 27, 2023 · 2 comments
Open

Cannot add users into protected branch list #823

tomhub opened this issue Feb 27, 2023 · 2 comments

Comments

@tomhub
Copy link

tomhub commented Feb 27, 2023

I am able to add protected branches, but I cannot include users. When I select users and click save, I get this:

I, [2023-02-27T12:10:52.666116 #71]  INFO -- : Started PUT "/repositories/12/protected_branches/19" for 10.23.36.15 at 2023-02-27 12:10:52 +0000
I, [2023-02-27T12:10:52.667266 #71]  INFO -- : Processing by RepositoryProtectedBranchesController#update as JS
I, [2023-02-27T12:10:52.667439 #71]  INFO -- :    Parameters: {"utf8"=>"✓", "authenticity_token"=>"xxx", "repository_protected_branche"=>{"path"=>"dev/", "permissions"=>"RW+"}, "user_ids"=>["", "5"], "group_ids"=>[""], "commit"=>"Save", "repository_id"=>"12", "id"=>"19"}
I, [2023-02-27T12:10:52.672267 #71]  INFO -- :    Current user: xxx (id=5)
I, [2023-02-27T12:10:52.684013 #71]  INFO -- :  Completed 500 Internal Server Error in 16ms (ActiveRecord: 3.8ms | Allocations: 4103)
F, [2023-02-27T12:10:52.685072 #71] FATAL -- :   
 ArgumentError (wrong number of arguments (given 4, expected 3)):
   
 plugins/redmine_git_hosting/app/use_cases/repository_protected_branches/member_manager.rb:63:in `create_member'
 plugins/redmine_git_hosting/app/use_cases/repository_protected_branches/member_manager.rb:41:in `create_user_member'
 plugins/redmine_git_hosting/app/use_cases/repository_protected_branches/member_manager.rb:29:in `add_users'
 plugins/redmine_git_hosting/app/controllers/repository_protected_branches_controller.rb:79:in `check_members'
 plugins/redmine_git_hosting/app/controllers/repository_protected_branches_controller.rb:34:in `update'
 lib/redmine/sudo_mode.rb:61:in `sudo_mode'

setup:

Environment:
  Redmine version                5.0.4.stable
  Ruby version                   3.0.5-p211 (2022-11-24) [x86_64-linux]
  Rails version                  6.1.7
  Environment                    production
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Alternate
SCM:
  Git                            2.39.2
  Filesystem                     
  Xitolite                       2.39.2
Redmine plugins:
  additionals                    3.0.8
  redmine_git_hosting            6.0.1
  redmine_privacy_terms          1.0.6
  redmine_spent_time             4.1.0
@HighwayStar
Copy link

We have this issue too

@HighwayStar
Copy link

It seems like these changes needed

diff --git a/app/use_cases/repository_protected_branches/member_manager.rb b/app/use_cases/repository_protected_branches/member_manager.rb
index 3edada14..ddab2614 100644
--- a/app/use_cases/repository_protected_branches/member_manager.rb
+++ b/app/use_cases/repository_protected_branches/member_manager.rb
@@ -38,11 +38,11 @@ module RepositoryProtectedBranches
     end
 
     def create_user_member(ids, current_ids, opts = {}, &block)
-      create_member(ids, current_ids, User, opts, &block)
+      create_member(ids, current_ids, User, **opts, &block)
     end
 
     def create_group_member(ids, current_ids, opts = {}, &block)
-      create_member(ids, current_ids, Group, opts, &block)
+      create_member(ids, current_ids, Group, **opts, &block)
     end
 
     def add_user_from_group(user, group_id)

HighwayStar added a commit to HighwayStar/redmine_git_hosting that referenced this issue Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants