Commit f99cd918 authored by Benni Mack's avatar Benni Mack
Browse files

[BUGFIX] Fix PHP 8 notices in workspaces preview

Resolves: #96430
Releases: main, 11.5
Change-Id: I8569537d90ee5dc74157db4f3e583366b82a2e27
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72786


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 18b65882
......@@ -203,10 +203,10 @@ class PreviewController
'enablePreviousStageButton' => $this->isValidStage($previousStage),
'enableNextStageButton' => $this->isValidStage($nextStage),
'enableDiscardStageButton' => $this->isValidStage($nextStage) || $this->isValidStage($previousStage),
'nextStage' => $nextStage['title'],
'nextStageId' => $nextStage['uid'],
'prevStage' => $previousStage['title'],
'prevStageId' => $previousStage['uid'],
'nextStage' => $nextStage['title'] ?? '',
'nextStageId' => $nextStage['uid'] ?? 0,
'prevStage' => $previousStage['title'] ?? '',
'prevStageId' => $previousStage['uid'] ?? 0,
]);
$this->moduleTemplate->setContent($this->view->render());
......
......@@ -94,7 +94,7 @@ class StagesService implements SingletonInterface
continue;
}
foreach ($items as $item) {
$usedStages[$item['t3ver_stage']] = true;
$usedStages[$item['t3ver_stage'] ?? 0] = true;
}
}
foreach ($availableStagesForWS as $stage) {
......@@ -105,7 +105,7 @@ class StagesService implements SingletonInterface
}
}
foreach ($availableStagesForWSUser as $userWS) {
if ($previousStage['uid'] == $userWS['uid']) {
if ($previousStage && $previousStage['uid'] == $userWS['uid']) {
$found = true;
break;
}
......@@ -142,7 +142,7 @@ class StagesService implements SingletonInterface
continue;
}
foreach ($items as $item) {
$usedStages[$item['t3ver_stage']] = true;
$usedStages[$item['t3ver_stage'] ?? 0] = true;
}
}
foreach ($availableStagesForWS as $stage) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment