Skip to content
Snippets Groups Projects
Commit a4a27c9e authored by Matthias Adrowski's avatar Matthias Adrowski
Browse files

[TASK] Migrate SingleViewController

parent f71c8cd8
No related branches found
No related tags found
1 merge request!38Feature upgrade to typo3 11
...@@ -65,18 +65,28 @@ class SingleViewController extends AbstractController { ...@@ -65,18 +65,28 @@ class SingleViewController extends AbstractController {
* @return void * @return void
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
*/ */
public function singleViewAction() { public function singleViewAction(): ?\Psr\Http\Message\ResponseInterface {
/** @var News $news */ /** @var News $news */
$currentId = (int) $GLOBALS['TSFE']->id; $currentId = (int) $GLOBALS['TSFE']->id;
$news = $this->newsRepository->findByUid($currentId); $news = $this->newsRepository->findByUid($currentId);
if (!$news) { if (!$news) {
return; if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '11.0.0', '<')) {
return NULL;
}
else {
return $this->htmlResponse();
}
} }
/** @var Category $newsCategory */ /** @var Category $newsCategory */
$newsCategory = $this->categoryRepository->findByUid($news->getPid()); $newsCategory = $this->categoryRepository->findByUid($news->getPid());
if (!$newsCategory) { if (!$newsCategory) {
return; if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '11.0.0', '<')) {
return NULL;
}
else {
return $this->htmlResponse();
}
} }
$newsMetaData = $this->getMetaDataForNews($news, $newsCategory); $newsMetaData = $this->getMetaDataForNews($news, $newsCategory);
...@@ -102,6 +112,12 @@ class SingleViewController extends AbstractController { ...@@ -102,6 +112,12 @@ class SingleViewController extends AbstractController {
'newsAuthor' => $news->getNewsAuthor(), 'newsAuthor' => $news->getNewsAuthor(),
] ]
); );
if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '11.0.0', '<')) {
return NULL;
}
else {
return $this->htmlResponse();
}
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment