Skip to content

Commit

Permalink
[BUGFIX] Fix errors caused by missing keys in entry array (#1347)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Meyer <[email protected]>
  • Loading branch information
beatrycze-volk and sebastian-meyer authored Oct 8, 2024
1 parent 0baa144 commit 63041f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Classes/Controller/TableOfContentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private function getMenuEntry(array $entry, bool $recursive = false): array
$entryArray['doNotLinkIt'] = 1;
$entryArray['ITEM_STATE'] = 'NO';

$this->buildMenuLinks($entryArray, $entry['id'], $entry['points'], $entry['targetUid']);
$this->buildMenuLinks($entryArray, $entry['id'], $entry['points'] ?? null, $entry['targetUid'] ?? null);

// Set "ITEM_STATE" to "CUR" if this entry points to current page.
if (in_array($entry['id'], $this->activeEntries)) {
Expand All @@ -148,7 +148,7 @@ private function getMenuEntry(array $entry, bool $recursive = false): array
// 3. Current menu node has no corresponding images
if (
$entryArray['ITEM_STATE'] == 'CUR'
|| is_string($entry['points'])
|| (array_key_exists('points', $entry) && is_string($entry['points']))
|| empty($this->document->getCurrentDocument()->smLinks['l2p'][$entry['id']])
) {
$entryArray['_SUB_MENU'] = [];
Expand Down Expand Up @@ -241,7 +241,7 @@ private function resolveMenuEntry(array $entry): array
$doc = $this->document->getCurrentDocument();
if (
$doc instanceof MetsDocument
&& ($entry['points'] === $doc->parentHref || $this->isMultiElement($entry['type']))
&& ((array_key_exists('points', $entry) && $entry['points'] === $doc->parentHref) || $this->isMultiElement($entry['type']))
&& !empty($this->document->getPartof())
) {
unset($entry['points']);
Expand Down

0 comments on commit 63041f8

Please sign in to comment.