From 02493e95400435ed920c2cb64e598ed5b75ef7d6 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Mon, 5 Feb 2024 14:59:20 +0100 Subject: [PATCH] Update TYPO3 v13.0 --- Classes/EventListener/PageLayoutHeader.php | 2 +- Classes/Frontend/DataProcessing/CategoriesCounts.php | 4 ++-- .../DataProcessing/NaturalSortingProcessor.php | 4 ++-- Classes/Frontend/RssFeed/SitemapDataProvider.php | 2 +- Classes/Frontend/RssFeed/XmlSitemapRenderer.php | 2 +- Configuration/Services.yaml | 2 -- Configuration/Services/Tracking.yaml | 5 ----- .../{UserTSconfig/Options.tsconfig => user.tsconfig} | 0 ext_localconf.php | 8 +++++--- ext_tables.php | 10 ---------- 10 files changed, 12 insertions(+), 27 deletions(-) rename Configuration/{UserTSconfig/Options.tsconfig => user.tsconfig} (100%) delete mode 100644 ext_tables.php diff --git a/Classes/EventListener/PageLayoutHeader.php b/Classes/EventListener/PageLayoutHeader.php index 3fdff32..e565bf6 100644 --- a/Classes/EventListener/PageLayoutHeader.php +++ b/Classes/EventListener/PageLayoutHeader.php @@ -91,7 +91,7 @@ class PageLayoutHeader private function resolvePageMedia(int $pageUid): array { - $files = new FileCollector(); + $files = GeneralUtility::makeInstance(FileCollector::class); $files->addFilesFromRelation('pages', 'media', ['uid' => $pageUid]); return $files->getFiles(); diff --git a/Classes/Frontend/DataProcessing/CategoriesCounts.php b/Classes/Frontend/DataProcessing/CategoriesCounts.php index 41d178b..969ad9f 100644 --- a/Classes/Frontend/DataProcessing/CategoriesCounts.php +++ b/Classes/Frontend/DataProcessing/CategoriesCounts.php @@ -95,10 +95,10 @@ class CategoriesCounts implements DataProcessorInterface $queryBuilder->addOrderBy($orderBy[0], $orderBy[1]); } - $statement = $queryBuilder->execute(); + $statement = $queryBuilder->executeQuery(); $categories = []; - while ($category = $statement->fetch()) { + while ($category = $statement->fetchAssociative()) { $categories[] = [ 'data' => $category, ]; diff --git a/Classes/Frontend/DataProcessing/NaturalSortingProcessor.php b/Classes/Frontend/DataProcessing/NaturalSortingProcessor.php index 27b5541..061ef52 100644 --- a/Classes/Frontend/DataProcessing/NaturalSortingProcessor.php +++ b/Classes/Frontend/DataProcessing/NaturalSortingProcessor.php @@ -64,8 +64,8 @@ class NaturalSortingProcessor implements DataProcessorInterface throw new \Exception('Variable at "' . $variablePath . '" was not of type array.', 1667911071); } - $valuesToSort = array_filter($valuesToSort, function (array $value) use ($variableSubPath) { - return ArrayUtility::getValueByPath($value, $variableSubPath); + $valuesToSort = array_filter($valuesToSort, function (array $value) use ($variableSubPath): bool { + return ArrayUtility::getValueByPath($value, $variableSubPath) == true; }); usort($valuesToSort, function (array $variable1, array $variable2) use ($variableSubPath) { diff --git a/Classes/Frontend/RssFeed/SitemapDataProvider.php b/Classes/Frontend/RssFeed/SitemapDataProvider.php index d7adf47..aaf21d5 100644 --- a/Classes/Frontend/RssFeed/SitemapDataProvider.php +++ b/Classes/Frontend/RssFeed/SitemapDataProvider.php @@ -95,7 +95,7 @@ class SitemapDataProvider extends RecordsXmlSitemapDataProvider return array_map(function (array $row) { return (int) $row['uid']; - }, $queryBuilder->execute()->fetchAll()); + }, $queryBuilder->executeQuery()->fetchAllAssociative()); } private function createAdditionalWhereForPageUids(array $pageUids): string diff --git a/Classes/Frontend/RssFeed/XmlSitemapRenderer.php b/Classes/Frontend/RssFeed/XmlSitemapRenderer.php index 70ef937..2796326 100644 --- a/Classes/Frontend/RssFeed/XmlSitemapRenderer.php +++ b/Classes/Frontend/RssFeed/XmlSitemapRenderer.php @@ -73,7 +73,7 @@ class XmlSitemapRenderer $this->typoScriptConfiguration = $typoScriptConfiguration; $this->initialize($GLOBALS['TSFE']->tmpl->setup); - $this->view->assign('type', $GLOBALS['TSFE']->type); + $this->view->assign('type', $request->getAttribute('routing')?->getPageType() ?? 0); $sitemapType = $typoScriptConfiguration['sitemapType'] ?? 'xmlSitemap'; if (!empty($sitemap = ($request->getQueryParams()['sitemap'] ?? null))) { return $this->renderSitemap($request, $sitemap, $sitemapType); diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index f26d495..b962b1f 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -33,7 +33,6 @@ services: dashboard.widget.site_ownrss: class: 'TYPO3\CMS\Dashboard\Widgets\RssWidget' arguments: - $view: '@dashboard.views.widget' $cache: '@cache.dashboard.rss' $options: feedUrl: 'https://daniel-siepmann.de/rss-feed/blog-posts.xml' @@ -52,7 +51,6 @@ services: class: 'TYPO3\CMS\Dashboard\Widgets\BarChartWidget' arguments: $dataProvider: '@TYPO3\CMS\Dashboard\Widgets\Provider\SysLogErrorsDataProvider' - $view: '@dashboard.views.widget' $buttonProvider: '@TYPO3\CMS\Dashboard\Widgets\Provider\SysLogButtonProvider' tags: - name: dashboard.widget diff --git a/Configuration/Services/Tracking.yaml b/Configuration/Services/Tracking.yaml index 059f5a9..c399473 100644 --- a/Configuration/Services/Tracking.yaml +++ b/Configuration/Services/Tracking.yaml @@ -28,7 +28,6 @@ services: dashboard.widget.danielsiepmann.tracking.pageViewsPerPage7_days: class: 'TYPO3\CMS\Dashboard\Widgets\DoughnutChartWidget' arguments: - $view: '@dashboard.views.widget' $dataProvider: '@DanielSiepmann\Tracking\Dashboard\Provider\PageviewsPerPage7_days' tags: - name: 'dashboard.widget' @@ -50,7 +49,6 @@ services: dashboard.widget.danielsiepmann.tracking.pageViewsPerPage365_days: class: 'TYPO3\CMS\Dashboard\Widgets\DoughnutChartWidget' arguments: - $view: '@dashboard.views.widget' $dataProvider: '@DanielSiepmann\Tracking\Dashboard\Provider\PageviewsPerPage365_days' tags: - name: 'dashboard.widget' @@ -71,7 +69,6 @@ services: dashboard.widget.danielsiepmann.tracking.records.topics: class: 'TYPO3\CMS\Dashboard\Widgets\DoughnutChartWidget' arguments: - $view: '@dashboard.views.widget' $dataProvider: '@dashboard.provider.danielsiepmann.tracking.records.topics' tags: - name: 'dashboard.widget' @@ -93,7 +90,6 @@ services: dashboard.widget.danielsiepmann.tracking.records.topics7_days: class: 'TYPO3\CMS\Dashboard\Widgets\DoughnutChartWidget' arguments: - $view: '@dashboard.views.widget' $dataProvider: '@dashboard.provider.danielsiepmann.tracking.records.topics7_days' tags: - name: 'dashboard.widget' @@ -115,7 +111,6 @@ services: dashboard.widget.danielsiepmann.tracking.records.topics365_days: class: 'TYPO3\CMS\Dashboard\Widgets\DoughnutChartWidget' arguments: - $view: '@dashboard.views.widget' $dataProvider: '@dashboard.provider.danielsiepmann.tracking.records.topics365_days' tags: - name: 'dashboard.widget' diff --git a/Configuration/UserTSconfig/Options.tsconfig b/Configuration/user.tsconfig similarity index 100% rename from Configuration/UserTSconfig/Options.tsconfig rename to Configuration/user.tsconfig diff --git a/ext_localconf.php b/ext_localconf.php index 7746a7d..7b5f17c 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -2,6 +2,11 @@ (function (string $extKey) { \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TYPO3_CONF_VARS'], [ + 'BE' => [ + 'stylesheets' => [ + $extKey => 'EXT:' . $extKey . '/Resources/Public/Backend/Css/', + ], + ], 'RTE' => [ 'Presets' => [ 'default' => 'EXT:ds_site/Configuration/RTE/Default.yaml', @@ -17,7 +22,4 @@ ], ], ]); - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig( - "@import 'EXT:ds_site/Configuration/UserTSconfig/*.tsconfig'" - ); })('ds_site'); diff --git a/ext_tables.php b/ext_tables.php deleted file mode 100644 index 48d427b..0000000 --- a/ext_tables.php +++ /dev/null @@ -1,10 +0,0 @@ - $extensionKey, - 'stylesheetDirectories' => [ - 'css' => 'EXT:' . $extensionKey . '/Resources/Public/Backend/Css/' - ] - ]; -})('ds_site');