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

[TASK] Migrate Latest + ListByCategoryController

parent ec9cc899
No related branches found
No related tags found
1 merge request!38Feature upgrade to typo3 11
......@@ -63,7 +63,7 @@ class LatestController extends AbstractController {
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
* @throws \TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException
*/
public function indexAction(array $newsMetaData = [], $offset = 0) {
public function indexAction(array $newsMetaData = [], $offset = 0): ?\Psr\Http\Message\ResponseInterface {
$limit = ((int) $this->settings['limit']);
$limit = ($limit < 1 ? 1 : $limit);
......@@ -104,6 +104,12 @@ class LatestController extends AbstractController {
}
$this->view->assign('newsMetaData', $newsMetaData);
if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '11.0.0', '<')) {
return NULL;
}
else {
return $this->htmlResponse();
}
}
/**
......
......@@ -103,7 +103,7 @@ class ListByCategoryController extends AbstractController {
* @throws ImmediateResponseException
* @throws \TYPO3\CMS\Core\Error\Http\PageNotFoundException
*/
public function indexAction(array $newsMetaData = [], int $currentPageBrowserPage = 0) {
public function indexAction(array $newsMetaData = [], int $currentPageBrowserPage = 0): ?\Psr\Http\Message\ResponseInterface {
$filterByCategories = FALSE;
$categoryUids = GeneralUtility::intExplode(',', $this->settings['categories']);
$tagUids = GeneralUtility::intExplode(',', $this->settings['tags'], TRUE);
......@@ -183,5 +183,12 @@ class ListByCategoryController extends AbstractController {
$this->view->assign('numberOfPages', $numberOfPages);
$this->view->assign('newsMetaData', $newsMetaData);
$this->view->assign('categories', $categories);
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