Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib#10511 menu item of type series without content even when they exist in the OMP 3.4 #1763

Open
wants to merge 1 commit into
base: stable-3_4_0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,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();
}
Comment on lines +48 to +52
Copy link
Contributor

@jonasraoni jonasraoni Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the previous code can be kept, but fixed. Please, apply the fix below (there's a button somewhere on the GitHub interface 🙃).

Suggested change
$seriesTitles = [];
foreach ($series as $seriesObj) {
$seriesTitles[$seriesObj->getId()] = $seriesObj->getLocalizedTitle();
}
$seriesTitles = $series->mapWithKeys(fn (Section $seriesObj) => [
$seriesObj->getId() => $seriesObj->getLocalizedTitle()
])->all();


$categories = Repo::category()->getCollector()
->filterByParentIds([null])
Expand Down
Loading