Skip to content

Commit

Permalink
[BUGFIX] Fix PHP 8 notices in workspaces preview
Browse files Browse the repository at this point in the history
Resolves: #96430
Releases: main, 11.5
Change-Id: I8569537d90ee5dc74157db4f3e583366b82a2e27
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72800
Reviewed-by: Simon Gilli <typo3@gilbertsoft.org>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Simon Gilli <typo3@gilbertsoft.org>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Benni Mack <benni@typo3.org>
  • Loading branch information
bmack committed Dec 23, 2021
1 parent 9d044ba commit 4853ef7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ public function handleRequest(ServerRequestInterface $request): ResponseInterfac
'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());
Expand Down
6 changes: 3 additions & 3 deletions typo3/sysext/workspaces/Classes/Service/StagesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function getPreviousStageForElementCollection(
continue;
}
foreach ($items as $item) {
$usedStages[$item['t3ver_stage']] = true;
$usedStages[$item['t3ver_stage'] ?? 0] = true;
}
}
foreach ($availableStagesForWS as $stage) {
Expand All @@ -105,7 +105,7 @@ public function getPreviousStageForElementCollection(
}
}
foreach ($availableStagesForWSUser as $userWS) {
if ($previousStage['uid'] == $userWS['uid']) {
if ($previousStage && $previousStage['uid'] == $userWS['uid']) {
$found = true;
break;
}
Expand Down Expand Up @@ -142,7 +142,7 @@ public function getNextStageForElementCollection(
continue;
}
foreach ($items as $item) {
$usedStages[$item['t3ver_stage']] = true;
$usedStages[$item['t3ver_stage'] ?? 0] = true;
}
}
foreach ($availableStagesForWS as $stage) {
Expand Down

0 comments on commit 4853ef7

Please sign in to comment.