Skip to content

Commit

Permalink
Fix removing members from acp
Browse files Browse the repository at this point in the history
  • Loading branch information
jdarwood007 committed Jan 20, 2024
1 parent 97959a7 commit 8a2633e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/Actions/Admin/Membergroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,10 @@ public function edit(): void
ErrorHandler::fatalLang('membergroup_does_not_exist', false);
}

@list($group) = Group::load($_REQUEST['group']);
$groups = Group::load((int) $_REQUEST['group']);

/** @var \SMF\Group $group */
$group = array_shift($groups);

if (!isset($group) || !($group instanceof Group)) {
ErrorHandler::fatalLang('membergroup_does_not_exist', false);
Expand Down
3 changes: 3 additions & 0 deletions Sources/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,9 @@ public function removeMembers(int|array $members, bool $perms_checked = false, b

// Load the user info for the members being removed.
$members = User::load($members, User::LOAD_BY_ID, 'minimal');
$members = array_map(function (\SMF\User $mem){
return $mem->id;
}, $members);

// Figure out which members should have their primary group changed and
// which should have their additional groups changed.
Expand Down

0 comments on commit 8a2633e

Please sign in to comment.