diff --git a/classes/components/forms/context/PKPAppearanceMastheadForm.php b/classes/components/forms/context/PKPAppearanceMastheadForm.php index 2a23dec51a6..b321ec04799 100644 --- a/classes/components/forms/context/PKPAppearanceMastheadForm.php +++ b/classes/components/forms/context/PKPAppearanceMastheadForm.php @@ -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[] = [ diff --git a/pages/about/AboutContextHandler.php b/pages/about/AboutContextHandler.php index 11cea7b3bcc..30ae3c46f6d 100644 --- a/pages/about/AboutContextHandler.php +++ b/pages/about/AboutContextHandler.php @@ -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()); @@ -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);