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

[TASK] Fix more php8.1 problems

parent ee14cab4
No related branches found
No related tags found
1 merge request!38Feature upgrade to typo3 11
......@@ -64,14 +64,17 @@ class LatestController extends AbstractController {
* @throws \TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException
*/
public function indexAction(array $newsMetaData = [], $offset = 0): ?\Psr\Http\Message\ResponseInterface {
$limit = ((int) $this->settings['limit']);
$limit = 0;
if (isset($this->settings['limit'])) {
$limit = ((int) $this->settings['limit']);
}
$limit = ($limit < 1 ? 1 : $limit);
$configurationService = GeneralUtility::makeInstance(ConfigurationService::class);
$sortBy = $configurationService->getConfiguration('sortBy', $this->settings);
$categoryUids = NULL;
$tagUids = NULL;
$categoryUids = [];
$tagUids = [];
if (isset($this->settings['categories'])) {
$categoryUids = GeneralUtility::intExplode(',', $this->settings['categories'], TRUE);
}
......
......@@ -86,7 +86,9 @@ class ListByCategoryController extends AbstractController {
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException
*/
public function initializeIndexAction() {
$currentPageBrowserPage = (int) GeneralUtility::_GP('tx_sgnews_pagebrowser')['currentPage'];
$currentPageBrowserPage = GeneralUtility::_GP('tx_sgnews_pagebrowser')
? (int) GeneralUtility::_GP('tx_sgnews_pagebrowser')['currentPage']
: 0;
if ($currentPageBrowserPage > 0) {
$this->request->setArgument('currentPageBrowserPage', $currentPageBrowserPage);
}
......@@ -106,8 +108,14 @@ class ListByCategoryController extends AbstractController {
*/
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);
$categoryUids = [];
$tagUids = [];
if (isset($this->settings['categories'])) {
$categoryUids = GeneralUtility::intExplode(',', $this->settings['categories'], TRUE);
}
if (isset($this->settings['tags'])) {
$tagUids = GeneralUtility::intExplode(',', $this->settings['tags'], TRUE);
}
foreach ($categoryUids as $categoryUid) {
if ($categoryUid > 0) {
$filterByCategories = TRUE;
......@@ -135,8 +143,14 @@ class ListByCategoryController extends AbstractController {
}
}
$startTime = (int) $this->settings['starttime'];
$endTime = (int) $this->settings['endtime'];
$startTime = 0;
$endTime = 0;
if (isset($this->settings['starttime'])) {
$startTime = (int) $this->settings['starttime'];
}
if (isset($this->settings['endtime'])) {
$endTime = (int) $this->settings['endtime'];
}
$newsPerPage = (int) $this->settings['newsLimitPerPage'];
$newsCount = $this->newsRepository->newsCountByCategories($categoryUids, $tagUids, $startTime, $endTime);
......
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