diff --git a/Classes/Controller/NewsByAuthorController.php b/Classes/Controller/NewsByAuthorController.php index 4ace64d3cd03019ceb74e63fe1c9a6e1e63a5abd..970663276d0afe49ff7236c3e385c548f3e425c7 100644 --- a/Classes/Controller/NewsByAuthorController.php +++ b/Classes/Controller/NewsByAuthorController.php @@ -49,13 +49,18 @@ class NewsByAuthorController extends AbstractController { * @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException * @throws \TYPO3\CMS\Core\Package\Exception */ - public function listAction($authorId = 0): void { + public function listAction($authorId = 0): ?\Psr\Http\Message\ResponseInterface { if ($authorId) { $newsAuthorsIds[] = $authorId; } else { $newsAuthorsIds = GeneralUtility::intExplode(',', $this->settings['newsAuthors']); if (\count($newsAuthorsIds) <= 0) { - return; + if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '11.0.0', '<')) { + return NULL; + } + else { + return $this->htmlResponse(); + } } } @@ -88,13 +93,23 @@ class NewsByAuthorController extends AbstractController { } if (\count($authors) <= 0) { - return; + if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '11.0.0', '<')) { + return NULL; + } + else { + return $this->htmlResponse(); + } } $newsRepository = $this->objectManager->get(NewsRepository::class); $news = $newsRepository->findAllByNewsAuthor($newsAuthorsIds); if (\count($news) <= 0) { - return; + if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '11.0.0', '<')) { + return NULL; + } + else { + return $this->htmlResponse(); + } } $categories = $newsMetaData = []; @@ -124,5 +139,12 @@ class NewsByAuthorController extends AbstractController { $this->view->assign('newsMetaData', $newsMetaData); $this->view->assign('authors', $authors); + + if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '11.0.0', '<')) { + return NULL; + } + else { + return $this->htmlResponse(); + } } }