diff --git a/Classes/Command/BaseCommand.php b/Classes/Command/BaseCommand.php index 980b7cf12..5b97339f3 100644 --- a/Classes/Command/BaseCommand.php +++ b/Classes/Command/BaseCommand.php @@ -172,11 +172,9 @@ protected function getSolrCores(int $pageId): array */ protected function saveToDatabase(Document $document) { - $success = false; - $doc = $document->getDoc(); if ($doc === null) { - return $success; + return false; } $doc->cPid = $this->storagePid; @@ -196,7 +194,7 @@ protected function saveToDatabase(Document $document) $document->setAuthor(implode('; ', $metadata['author'])); $document->setThumbnail($doc->thumbnail ? : ''); $document->setMetsLabel($metadata['mets_label'][0] ? : ''); - $document->setMetsOrderlabel($metadata['mets_orderlabel'][0] ? : ''); + $document->setMetsOrderlabel($metadata['mets_orderlabel'][0] ? : $metadata['mets_order'][0] ? : ''); $structure = $this->structureRepository->findOneByIndexName($metadata['type'][0], 'tx_dlf_structures'); $document->setStructure($structure); @@ -258,9 +256,9 @@ protected function saveToDatabase(Document $document) } } - // to be still (re-) implemented - // 'volume' => $metadata['volume'][0], - // 'volume_sorting' => $metadata['volume_sorting'][0], + // set volume data + $document->setVolume($metadata['volume'][0] ? : ''); + $document->setVolumeSorting($metadata['volume_sorting'][0] ? : ''); // Get UID of parent document. if ($document->getDocumentFormat() === 'METS') { @@ -278,9 +276,7 @@ protected function saveToDatabase(Document $document) $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); $persistenceManager->persistAll(); - $success = true; - - return $success; + return true; } /** diff --git a/Classes/Controller/TableOfContentsController.php b/Classes/Controller/TableOfContentsController.php index f0d7e554b..9ad3cf7a4 100644 --- a/Classes/Controller/TableOfContentsController.php +++ b/Classes/Controller/TableOfContentsController.php @@ -141,6 +141,10 @@ protected function getMenuEntry(array $entry, $recursive = false) $entryArray['_OVERRIDE_HREF'] = ''; $entryArray['doNotLinkIt'] = 1; $entryArray['ITEM_STATE'] = 'NO'; + + if ($entry['type'] == 'volume') { + $entryArray['title'] = $this->getTranslatedType($entry['type']) . ' ' . $entry['volume']; + } // Build menu links based on the $entry['points'] array. if ( !empty($entry['points']) @@ -251,7 +255,6 @@ private function getTranslatedType($type) { /** * Sort menu by orderlabel - currently implemented for newspaper. - * //TODO: add for years * * @param array &$menu * @return void