Skip to content

Commit

Permalink
[BUGFIX] Fix return type for getTableOfContentsFromDb function (#986)
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 committed Jul 20, 2023
1 parent 2daf3df commit 613ade1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Classes/Controller/TableOfContentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected function makeMenuArray()
// Build table of contents from database.
$result = $this->documentRepository->getTableOfContentsFromDb($this->document->getUid(), $this->document->getPid(), $this->settings);

$allResults = $result->fetchAll();
$allResults = $result->fetchAllAssociative();

if (count($allResults) > 0) {
$menuArray[0]['ITEM_STATE'] = 'CURIFSUB';
Expand Down
7 changes: 3 additions & 4 deletions Classes/Domain/Repository/DocumentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public function findAllByCollectionsLimited($collections, $limit = 50)
* Volumes are documents that are both
* a) "leaf" elements i.e. partof != 0
* b) "root" elements that are not referenced by other documents ("root" elements that have no descendants)
*
* @param array $settings
*
* @return array
Expand Down Expand Up @@ -347,7 +347,7 @@ public function getStatisticsForSelectedCollection($settings)
* @param int $pid
* @param array $settings
*
* @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface
* @return \Doctrine\DBAL\ForwardCompatibility\Result
*/
public function getTableOfContentsFromDb($uid, $pid, $settings)
{
Expand All @@ -360,7 +360,7 @@ public function getTableOfContentsFromDb($uid, $pid, $settings)
$excludeOtherWhere = 'tx_dlf_documents.pid=' . intval($settings['storagePid']);
}
// Check if there are any metadata to suggest.
$result = $queryBuilder
return $queryBuilder
->select(
'tx_dlf_documents.uid AS uid',
'tx_dlf_documents.title AS title',
Expand All @@ -387,7 +387,6 @@ public function getTableOfContentsFromDb($uid, $pid, $settings)
->addOrderBy('tx_dlf_documents.volume_sorting')
->addOrderBy('tx_dlf_documents.mets_orderlabel')
->execute();
return $result;
}

/**
Expand Down

0 comments on commit 613ade1

Please sign in to comment.