From 68938cb7e2757aca4104d91e334fee4fdf6ab762 Mon Sep 17 00:00:00 2001 From: yves Date: Thu, 14 Nov 2024 18:34:27 -0400 Subject: [PATCH] pkp/pkp-lib#10511 Fix bug of listing empty series when trying to insert a menu item with the series type. Signed-off-by: yves --- .../grid/navigationMenus/form/NavigationMenuItemsForm.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/controllers/grid/navigationMenus/form/NavigationMenuItemsForm.php b/controllers/grid/navigationMenus/form/NavigationMenuItemsForm.php index f179a9e9f71..5987cf34f82 100644 --- a/controllers/grid/navigationMenus/form/NavigationMenuItemsForm.php +++ b/controllers/grid/navigationMenus/form/NavigationMenuItemsForm.php @@ -44,9 +44,11 @@ public function fetch($request, $template = null, $display = false) ->getCollector() ->filterByContextIds([$contextId]) ->getMany(); - $seriesTitles = $series->map(fn (Section $seriesObj) => [ - $seriesObj->getId() => $seriesObj->getLocalizedTitle() - ]); + + $seriesTitles = []; + foreach ($series as $seriesObj) { + $seriesTitles[$seriesObj->getId()] = $seriesObj->getLocalizedTitle(); + } $categories = Repo::category()->getCollector() ->filterByParentIds([null])