Skip to content

Commit

Permalink
Fixing addition of multiple categories for multiple users
Browse files Browse the repository at this point in the history
  • Loading branch information
waximabbax committed Aug 6, 2024
1 parent afa239e commit 3e93819
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/EntryPoints/Specials/SpecialManageApprovers.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ private function handlePostRequest( WebRequest $request, array $approversCategor

$userWithCategories = array_filter( $approversCategories, fn( $approver ) => $approver->username === $username
);
$currentCategories = $userWithCategories[0]->categories ?? [];
$userWithCategories = reset( $userWithCategories );
$currentCategories = $userWithCategories !== false ? $userWithCategories->categories : [];

$this->processCategoryAction( $action, $category, $userId, $currentCategories );
}
Expand Down

0 comments on commit 3e93819

Please sign in to comment.