Skip to content

Commit

Permalink
#10375 Corectly consider roles removed from masthead with the custom …
Browse files Browse the repository at this point in the history
…order of the masthead roles in website settings
  • Loading branch information
bozana committed Sep 9, 2024
1 parent d33f414 commit 1765240
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct($action, $locales, $context)
->toArray();

// sort the mashead roles in their saved order
$sortedAllMastheadUserGroups = array_replace(array_flip($savedMastheadUserGroupIdsOrder), $allMastheadUserGroups);
$sortedAllMastheadUserGroups = array_replace(array_intersect_key(array_flip($savedMastheadUserGroupIdsOrder), $allMastheadUserGroups), $allMastheadUserGroups);

foreach ($sortedAllMastheadUserGroups as $userGroup) {
$mastheadOptions[] = [
Expand Down
4 changes: 2 additions & 2 deletions pages/about/AboutContextHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function editorialMasthead($args, $request)
->toArray();

// sort the masthead roles in their saved order for display
$mastheadRoles = array_replace(array_flip($savedMastheadUserGroupIdsOrder), $allMastheadUserGroups);
$mastheadRoles = array_replace(array_intersect_key(array_flip($savedMastheadUserGroupIdsOrder), $allMastheadUserGroups), $allMastheadUserGroups);

$allUsersIdsGroupedByUserGroupId = Repo::userGroup()->getMastheadUserIdsByRoleIds($mastheadRoles, $context->getId());

Expand Down Expand Up @@ -152,7 +152,7 @@ public function editorialHistory($args, $request)
->toArray();

// sort the masthead roles in their saved order for display
$mastheadRoles = array_replace(array_flip($savedMastheadUserGroupIdsOrder), $allMastheadUserGroups);
$mastheadRoles = array_replace(array_intersect_key(array_flip($savedMastheadUserGroupIdsOrder), $allMastheadUserGroups), $allMastheadUserGroups);

$allUsersIdsGroupedByUserGroupId = Repo::userGroup()->getMastheadUserIdsByRoleIds($mastheadRoles, $context->getId(), UserUserGroupStatus::STATUS_ENDED);

Expand Down

0 comments on commit 1765240

Please sign in to comment.