From c72dcdc7828c293e76575bca5ab51c75a9a31e51 Mon Sep 17 00:00:00 2001 From: Christian Kuhn Date: Sun, 13 Jun 2021 00:16:42 +0200 Subject: [PATCH] [BUGFIX] Remaining PHP 8.0 fixes for acceptance tests This fixes a bunch of PHP 8.0 warnings found by acceptance testing. image processing and ext:scheduler are affected for the main part. This makes the ac test suite green with PHP 8.0. The gitlab activation and another testing-framework raise will follow with dedicated patches. The patch brings an additional acceptance test for install tool 'Environment->Image Processing' since this worked well to nail lots of issues with GifBuilder and friends. Change-Id: Id22c7636da76778b75f087d20d7b7260cd2637ee Resolves: #94333 Related: #94057 Releases: master Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69476 Tested-by: Christian Kuhn Tested-by: Oliver Bartsch Tested-by: core-ci Tested-by: Benni Mack Reviewed-by: Christian Kuhn Reviewed-by: Oliver Bartsch Reviewed-by: Benni Mack --- Classes/Backend/Shortcut/ShortcutRepository.php | 2 +- Classes/Search/LiveSearch/LiveSearch.php | 2 +- Classes/Utility/BackendUtility.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Classes/Backend/Shortcut/ShortcutRepository.php b/Classes/Backend/Shortcut/ShortcutRepository.php index 4bc590799..ff8e6cc29 100644 --- a/Classes/Backend/Shortcut/ShortcutRepository.php +++ b/Classes/Backend/Shortcut/ShortcutRepository.php @@ -134,7 +134,7 @@ public function getGroupsFromShortcuts(): array $groups = []; foreach ($this->shortcuts as $shortcut) { - $groups[$shortcut['group']] = $this->shortcutGroups[$shortcut['group']]; + $groups[$shortcut['group']] = $this->shortcutGroups[$shortcut['group']] ?? ''; } return array_unique($groups); diff --git a/Classes/Search/LiveSearch/LiveSearch.php b/Classes/Search/LiveSearch/LiveSearch.php index 6e27ed5d4..79ffe1235 100644 --- a/Classes/Search/LiveSearch/LiveSearch.php +++ b/Classes/Search/LiveSearch/LiveSearch.php @@ -183,7 +183,7 @@ protected function findByTable($tableName, $pageIdList, $firstResult, $maxResult $queryBuilder->andWhere($this->userPermissions); } - $orderBy = $GLOBALS['TCA'][$tableName]['ctrl']['sortby'] ?? $GLOBALS['TCA'][$tableName]['ctrl']['default_sortby']; + $orderBy = $GLOBALS['TCA'][$tableName]['ctrl']['sortby'] ?? $GLOBALS['TCA'][$tableName]['ctrl']['default_sortby'] ?? ''; foreach (QueryHelper::parseOrderBy((string)$orderBy) as $orderPair) { [$fieldName, $order] = $orderPair; $queryBuilder->addOrderBy($fieldName, $order); diff --git a/Classes/Utility/BackendUtility.php b/Classes/Utility/BackendUtility.php index f18536123..1a80e8ecd 100644 --- a/Classes/Utility/BackendUtility.php +++ b/Classes/Utility/BackendUtility.php @@ -655,7 +655,7 @@ public static function getTCAtypeValue($table, $row) ); } $foreignRow = self::getRecord($foreignTable, $foreignUid, $foreignTableTypeField); - if ($foreignRow[$foreignTableTypeField]) { + if ($foreignRow[$foreignTableTypeField] ?? false) { $typeNum = $foreignRow[$foreignTableTypeField]; } } @@ -2750,7 +2750,7 @@ public static function getModuleData( $changed = 1; } } else { - if ((string)$settings[$key] !== (string)$CHANGED_SETTINGS[$key]) { + if ((string)($settings[$key] ?? '') !== (string)($CHANGED_SETTINGS[$key] ?? '')) { $settings[$key] = $CHANGED_SETTINGS[$key]; $changed = 1; }