From 53a50b3163781c673d68160d58b286d076fe8498 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Sat, 19 Oct 2024 10:22:04 +0200 Subject: [PATCH 1/9] [TASK] Prepare README for v14 --- README.rst | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 4929c6d7..f37ea268 100644 --- a/README.rst +++ b/README.rst @@ -6,10 +6,6 @@ :alt: TYPO3 13 :target: https://get.typo3.org/version/13 -.. image:: https://img.shields.io/badge/TYPO3-12-orange.svg - :alt: TYPO3 12 - :target: https://get.typo3.org/version/12 - .. image:: https://poser.pugx.org/t3g/blog/d/total :alt: Total Downloads :target: https://packagist.org/packages/t3g/blog @@ -53,6 +49,7 @@ Compatibility :header-rows: 1 * - + - v14 - v13 - v12 - v11 @@ -61,7 +58,18 @@ Compatibility - v8 - v7 + * - 14.0.x + - ✔️ + - ✔️ + - + - + - + - + - + - + * - 13.0.x + - - ✔️ - ✔️ - @@ -71,6 +79,7 @@ Compatibility - * - 12.0.x + - - - ✔️ - ✔️ @@ -80,6 +89,7 @@ Compatibility - * - 11.0.x + - - - - ✔️ @@ -92,6 +102,7 @@ Compatibility - - - + - - ✔️ - ✔️ - @@ -102,6 +113,7 @@ Compatibility - - - + - - ✔️ - - @@ -111,6 +123,7 @@ Compatibility - - - + - - ✔️ - - @@ -121,6 +134,7 @@ Compatibility - - - + - - ✔️ - @@ -131,6 +145,7 @@ Compatibility - - - + - - ✔️ License From 70ab282e60d5d030bed3542db395f14dc62f4360 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Sat, 19 Oct 2024 10:24:42 +0200 Subject: [PATCH 2/9] [TASK] Require at least TYPO3 v13 Drop v12 support because blog version v14 will rely on TYPO3 v13 site sets and drop sys_template support. --- .github/workflows/ci.yml | 11 +++-------- composer.json | 40 ++++++++++++++++++++-------------------- ext_emconf.php | 4 ++-- 3 files changed, 25 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f046d2f..1a9f51c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,14 +15,9 @@ jobs: strategy: fail-fast: false matrix: - typo3: ['^12', '^13'] - php: ['8.1', '8.2', '8.3'] - mysql: ['5.7', '8.0', '8.4'] - exclude: - - typo3: '^13' - mysql: '5.7' - - typo3: '^13' - php: '8.1' + typo3: ['^13'] + php: ['8.2', '8.3'] + mysql: ['8.0', '8.4'] steps: - id: checkout name: Checkout Code diff --git a/composer.json b/composer.json index bc09fd7d..2cf26f52 100644 --- a/composer.json +++ b/composer.json @@ -86,35 +86,35 @@ "psr/http-client": "^1.0", "psr/http-factory": "^1.0", "psr/http-message": "^1.1 || ^2.0", - "typo3/cms-backend": "^12.4 || ^13.4", - "typo3/cms-core": "^12.4 || ^13.4", - "typo3/cms-extbase": "^12.4 || ^13.4", - "typo3/cms-extensionmanager": "^12.4 || ^13.4", - "typo3/cms-fluid": "^12.4 || ^13.4", - "typo3/cms-form": "^12.4 || ^13.4", - "typo3/cms-frontend": "^12.4 || ^13.4", - "typo3/cms-install": "^12.4 || ^13.4", - "typo3fluid/fluid": "^2.15 || ^4.0" + "typo3/cms-backend": "^13.4", + "typo3/cms-core": "^13.4", + "typo3/cms-extbase": "^13.4", + "typo3/cms-extensionmanager": "^13.4", + "typo3/cms-fluid": "^13.4", + "typo3/cms-form": "^13.4", + "typo3/cms-frontend": "^13.4", + "typo3/cms-install": "^13.4", + "typo3fluid/fluid": "^4.0" }, "require-dev": { "bk2k/bootstrap-package": "^15.0", "bk2k/extension-helper": "^2.0", "friendsofphp/php-cs-fixer": "^3.14", "friendsoftypo3/phpstan-typo3": "^0.9.0", - "overtrue/phplint": "^3.4 || ^9.0", + "overtrue/phplint": "^9.0", "phpstan/phpstan": "^1.10", "phpstan/phpstan-deprecation-rules": "^1.1", "phpstan/phpstan-phpunit": "^1.3", "phpstan/phpstan-strict-rules": "^1.5", - "typo3/cms-belog": "^12.4 || ^13.4", - "typo3/cms-beuser": "^12.4 || ^13.4", - "typo3/cms-filelist": "^12.4 || ^13.4", - "typo3/cms-fluid-styled-content": "^12.4 || ^13.4", - "typo3/cms-lowlevel": "^12.4 || ^13.4", - "typo3/cms-rte-ckeditor": "^12.4 || ^13.4", - "typo3/cms-seo": "^12.4 || ^13.4", - "typo3/cms-setup": "^12.4 || ^13.4", - "typo3/cms-tstemplate": "^12.4 || ^13.4", - "typo3/testing-framework": "^8.0 || ^9.0" + "typo3/cms-belog": "^13.4", + "typo3/cms-beuser": "^13.4", + "typo3/cms-filelist": "^13.4", + "typo3/cms-fluid-styled-content": "^13.4", + "typo3/cms-lowlevel": "^13.4", + "typo3/cms-rte-ckeditor": "^13.4", + "typo3/cms-seo": "^13.4", + "typo3/cms-setup": "^13.4", + "typo3/cms-tstemplate": "^13.4", + "typo3/testing-framework": "^9.0" } } diff --git a/ext_emconf.php b/ext_emconf.php index b18566a6..12d1447b 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -17,8 +17,8 @@ 'version' => '13.0.0', 'constraints' => [ 'depends' => [ - 'typo3' => '12.4.22-13.4.99', - 'form' => '12.4.22-13.4.99', + 'typo3' => '13.4.0-13.4.99', + 'form' => '13.4.0-13.4.99', ], 'conflicts' => [], 'suggests' => [], From e96abd45467b09d0b13db802e01769671262db83 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Sat, 19 Oct 2024 10:26:37 +0200 Subject: [PATCH 3/9] [TASK] Remove version fallbacks --- Classes/Domain/Factory/CommentFormFactory.php | 9 ++------- Tests/Functional/SiteBasedTestCase.php | 10 +--------- .../ViewHelpers/Link/Be/AuthorViewHelperTest.php | 5 ----- .../ViewHelpers/Link/Be/CategoryViewHelperTest.php | 5 ----- .../ViewHelpers/Link/Be/CommentViewHelperTest.php | 5 ----- .../ViewHelpers/Link/Be/PostViewHelperTest.php | 5 ----- .../ViewHelpers/Link/Be/TagViewHelperTest.php | 5 ----- ext_tables.php | 9 --------- 8 files changed, 3 insertions(+), 50 deletions(-) diff --git a/Classes/Domain/Factory/CommentFormFactory.php b/Classes/Domain/Factory/CommentFormFactory.php index d66348eb..69e32edb 100644 --- a/Classes/Domain/Factory/CommentFormFactory.php +++ b/Classes/Domain/Factory/CommentFormFactory.php @@ -13,7 +13,6 @@ use Psr\Http\Message\ServerRequestInterface; use T3G\AgencyPack\Blog\Domain\Finisher\CommentFormFinisher; use T3G\AgencyPack\Blog\Domain\Validator\GoogleCaptchaValidator; -use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; @@ -88,12 +87,8 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv $commentField = $page->createElement('comment', 'Textarea'); $commentField->setLabel((string) LocalizationUtility::translate('form.comment.comment', 'blog')); $commentField->addValidator(GeneralUtility::makeInstance(NotEmptyValidator::class)); - if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() < 12) { - $stringLengthValidator = GeneralUtility::makeInstance(StringLengthValidator::class, ['minimum' => 5]); - } else { - $stringLengthValidator = GeneralUtility::makeInstance(StringLengthValidator::class); - $stringLengthValidator->setOptions(['minimum' => 5]); - } + $stringLengthValidator = GeneralUtility::makeInstance(StringLengthValidator::class); + $stringLengthValidator->setOptions(['minimum' => 5]); $commentField->addValidator($stringLengthValidator); $explanationText = $page->createElement('explanation', 'StaticText'); diff --git a/Tests/Functional/SiteBasedTestCase.php b/Tests/Functional/SiteBasedTestCase.php index f4bdc59c..b77d2d34 100644 --- a/Tests/Functional/SiteBasedTestCase.php +++ b/Tests/Functional/SiteBasedTestCase.php @@ -9,10 +9,8 @@ namespace T3G\AgencyPack\Blog\Tests\Functional; -use TYPO3\CMS\Core\Configuration\SiteConfiguration; use TYPO3\CMS\Core\Configuration\SiteWriter; use TYPO3\CMS\Core\Database\ConnectionPool; -use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -65,13 +63,7 @@ protected function createTestSite(): void ]; GeneralUtility::rmdir($this->instancePath . '/typo3conf/sites/' . $identifier, true); - if ((new Typo3Version())->getMajorVersion() >= 13) { - /** @phpstan-ignore-next-line */ - $this->get(SiteWriter::class)->write($identifier, $configuration); - } else { - /** @phpstan-ignore-next-line */ - $this->get(SiteConfiguration::class)->write($identifier, $configuration); - } + $this->get(SiteWriter::class)->write($identifier, $configuration); } protected function renderFluidTemplateInTestSite(string $template, array $instructions = []): string diff --git a/Tests/Functional/ViewHelpers/Link/Be/AuthorViewHelperTest.php b/Tests/Functional/ViewHelpers/Link/Be/AuthorViewHelperTest.php index 9b329664..0f4399f2 100644 --- a/Tests/Functional/ViewHelpers/Link/Be/AuthorViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Link/Be/AuthorViewHelperTest.php @@ -17,8 +17,6 @@ use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Http\NormalizedParams; use TYPO3\CMS\Core\Http\ServerRequest; -use TYPO3\CMS\Core\Information\Typo3Version; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextFactory; use TYPO3\CMS\Fluid\View\TemplateView; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -62,9 +60,6 @@ public function render(string $template, string $expected): void public static function renderDataProvider(): array { $expectedReturnUrl = '/'; - if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() < 12) { - $expectedReturnUrl = '%2F'; - } return [ 'simple' => [ diff --git a/Tests/Functional/ViewHelpers/Link/Be/CategoryViewHelperTest.php b/Tests/Functional/ViewHelpers/Link/Be/CategoryViewHelperTest.php index 223ef0ab..468b3326 100644 --- a/Tests/Functional/ViewHelpers/Link/Be/CategoryViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Link/Be/CategoryViewHelperTest.php @@ -17,8 +17,6 @@ use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Http\NormalizedParams; use TYPO3\CMS\Core\Http\ServerRequest; -use TYPO3\CMS\Core\Information\Typo3Version; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextFactory; use TYPO3\CMS\Fluid\View\TemplateView; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -61,9 +59,6 @@ public function render(string $template, string $expected): void public static function renderDataProvider(): array { $expectedReturnUrl = '/'; - if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() < 12) { - $expectedReturnUrl = '%2F'; - } return [ 'simple' => [ diff --git a/Tests/Functional/ViewHelpers/Link/Be/CommentViewHelperTest.php b/Tests/Functional/ViewHelpers/Link/Be/CommentViewHelperTest.php index 2951b840..e83abdfe 100644 --- a/Tests/Functional/ViewHelpers/Link/Be/CommentViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Link/Be/CommentViewHelperTest.php @@ -17,8 +17,6 @@ use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Http\NormalizedParams; use TYPO3\CMS\Core\Http\ServerRequest; -use TYPO3\CMS\Core\Information\Typo3Version; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextFactory; use TYPO3\CMS\Fluid\View\TemplateView; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -61,9 +59,6 @@ public function render(string $template, string $expected): void public static function renderDataProvider(): array { $expectedReturnUrl = '/'; - if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() < 12) { - $expectedReturnUrl = '%2F'; - } return [ 'simple' => [ diff --git a/Tests/Functional/ViewHelpers/Link/Be/PostViewHelperTest.php b/Tests/Functional/ViewHelpers/Link/Be/PostViewHelperTest.php index 1987e937..af884305 100644 --- a/Tests/Functional/ViewHelpers/Link/Be/PostViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Link/Be/PostViewHelperTest.php @@ -17,8 +17,6 @@ use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Http\NormalizedParams; use TYPO3\CMS\Core\Http\ServerRequest; -use TYPO3\CMS\Core\Information\Typo3Version; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextFactory; use TYPO3\CMS\Fluid\View\TemplateView; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -61,9 +59,6 @@ public function render(string $template, string $expected): void public static function renderDataProvider(): array { $expectedReturnUrl = '/'; - if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() < 12) { - $expectedReturnUrl = '%2F'; - } return [ 'simple' => [ diff --git a/Tests/Functional/ViewHelpers/Link/Be/TagViewHelperTest.php b/Tests/Functional/ViewHelpers/Link/Be/TagViewHelperTest.php index e16dbe95..f4110580 100644 --- a/Tests/Functional/ViewHelpers/Link/Be/TagViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Link/Be/TagViewHelperTest.php @@ -17,8 +17,6 @@ use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Http\NormalizedParams; use TYPO3\CMS\Core\Http\ServerRequest; -use TYPO3\CMS\Core\Information\Typo3Version; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextFactory; use TYPO3\CMS\Fluid\View\TemplateView; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -61,9 +59,6 @@ public function render(string $template, string $expected): void public static function renderDataProvider(): array { $expectedReturnUrl = '/'; - if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() < 12) { - $expectedReturnUrl = '%2F'; - } return [ 'simple' => [ diff --git a/ext_tables.php b/ext_tables.php index 30b307f0..873b7140 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -8,8 +8,6 @@ */ use T3G\AgencyPack\Blog\Constants; -use TYPO3\CMS\Core\Information\Typo3Version; -use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; if (!defined('TYPO3')) { die('Access denied.'); @@ -24,10 +22,3 @@ 'type' => 'web', 'allowedTables' => '*', ]; - -// Replaced with Configuration/user.tsconfig in v13 -if ((new Typo3Version())->getMajorVersion() < 13) { - ExtensionManagementUtility::addUserTSConfig(' - options.pageTree.doktypesToShowInNewPageDragArea := addToList(' . Constants::DOKTYPE_BLOG_POST . ') - '); -} From 6ddff88585775701fcd0b7c049df37f8e80fcb02 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Fri, 25 Oct 2024 08:38:00 +0200 Subject: [PATCH 4/9] [TASK] Replace File::FILETYPE_IMAGE constant with enum value --- Configuration/TCA/tx_blog_domain_model_author.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Configuration/TCA/tx_blog_domain_model_author.php b/Configuration/TCA/tx_blog_domain_model_author.php index e4ae0f83..604bc0fc 100644 --- a/Configuration/TCA/tx_blog_domain_model_author.php +++ b/Configuration/TCA/tx_blog_domain_model_author.php @@ -121,7 +121,7 @@ ], 'overrideChildTca' => [ 'types' => [ - \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + \TYPO3\CMS\Core\Resource\FileType::IMAGE->value => [ 'showitem' => ' crop, --palette--;;filePalette From b204c97af0d5c5e8ea7ef32b789e6ea11de221b9 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Sat, 19 Oct 2024 10:39:20 +0200 Subject: [PATCH 5/9] [TASK] Migrate plugins from list_type to CType --- Classes/Updates/ListTypeMigration.php | 49 ++++++++++++ .../Data/ContentListOptionsViewHelper.php | 4 +- .../DataHandler/BlogSetupRecords.php | 15 ++-- Configuration/TsConfig/Page/Wizards.tsconfig | 21 ++--- Tests/Functional/Fixtures/Site/tt_content.csv | 14 ++-- .../Data/ContentListOptionsViewHelperTest.php | 6 +- ext_localconf.php | 79 ++++++++++++++----- 7 files changed, 131 insertions(+), 57 deletions(-) create mode 100644 Classes/Updates/ListTypeMigration.php diff --git a/Classes/Updates/ListTypeMigration.php b/Classes/Updates/ListTypeMigration.php new file mode 100644 index 00000000..fa9d8510 --- /dev/null +++ b/Classes/Updates/ListTypeMigration.php @@ -0,0 +1,49 @@ +registerArgument('as', 'string', 'Name of variable to create.'); + // @todo renamee to CType $this->registerArgument('listType', 'string', 'Plugin Type to Render', true); } @@ -33,8 +34,7 @@ public function render(): string $listTypeConfiguration, [ 'uid' => Constants::LISTTYPE_TO_FAKE_UID_MAPPING[$arguments['listType']] ?? 0, - 'list_type' => $arguments['listType'] ?? '', - 'CType' => 'list', + 'CType' => $arguments['listType'] ?? '', 'layout' => $listTypeConfiguration['layout'] ?? '0', 'frame_class' => $listTypeConfiguration['frame_class'] ?? 'default' ] diff --git a/Configuration/DataHandler/BlogSetupRecords.php b/Configuration/DataHandler/BlogSetupRecords.php index f2bb9422..29e3381f 100644 --- a/Configuration/DataHandler/BlogSetupRecords.php +++ b/Configuration/DataHandler/BlogSetupRecords.php @@ -85,28 +85,23 @@ // Content elements $data['tt_content']['NEW_ListOfPosts'] = [ 'pid' => 'NEW_blogRoot', - 'CType' => 'list', - 'list_type' => 'blog_posts', + 'CType' => 'blog_posts', ]; $data['tt_content']['NEW_ListByCategory'] = [ 'pid' => 'NEW_blogCategoryPage', - 'CType' => 'list', - 'list_type' => 'blog_category', + 'CType' => 'blog_category', ]; $data['tt_content']['NEW_ListByTag'] = [ 'pid' => 'NEW_blogTagPage', - 'CType' => 'list', - 'list_type' => 'blog_tag', + 'CType' => 'blog_tag', ]; $data['tt_content']['NEW_ListByAuthor'] = [ 'pid' => 'NEW_blogAuthorPage', - 'CType' => 'list', - 'list_type' => 'blog_authorposts', + 'CType' => 'blog_authorposts', ]; $data['tt_content']['NEW_ListByDate'] = [ 'pid' => 'NEW_blogArchivePage', - 'CType' => 'list', - 'list_type' => 'blog_archive', + 'CType' => 'blog_archive', ]; // Content diff --git a/Configuration/TsConfig/Page/Wizards.tsconfig b/Configuration/TsConfig/Page/Wizards.tsconfig index 71555cd9..c98865be 100644 --- a/Configuration/TsConfig/Page/Wizards.tsconfig +++ b/Configuration/TsConfig/Page/Wizards.tsconfig @@ -10,8 +10,7 @@ mod.wizards.newContentElement.wizardItems.blog { title = LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_posts.title description = LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_posts.description tt_content_defValues { - CType = list - list_type = blog_posts + CType = blog_posts } } blog_latestposts { @@ -19,8 +18,7 @@ mod.wizards.newContentElement.wizardItems.blog { title = LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_latestposts.title description = LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_latestposts.description tt_content_defValues { - CType = list - list_type = blog_latestposts + CType = blog_latestposts } } blog_category { @@ -28,8 +26,7 @@ mod.wizards.newContentElement.wizardItems.blog { title = LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_category.title description = LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_category.description tt_content_defValues { - CType = list - list_type = blog_category + CType = blog_category } } blog_authorposts { @@ -37,8 +34,7 @@ mod.wizards.newContentElement.wizardItems.blog { title = LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_authorposts.title description = LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_authorposts.description tt_content_defValues { - CType = list - list_type = blog_authorposts + CType = blog_authorposts } } blog_tag { @@ -46,8 +42,7 @@ mod.wizards.newContentElement.wizardItems.blog { title = LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_tag.title description = LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_tag.description tt_content_defValues { - CType = list - list_type = blog_tag + CType = blog_tag } } blog_archive { @@ -55,8 +50,7 @@ mod.wizards.newContentElement.wizardItems.blog { title = LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_archive.title description = LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_archive.description tt_content_defValues { - CType = list - list_type = blog_archive + CType = blog_archive } } blog_demandedposts { @@ -64,8 +58,7 @@ mod.wizards.newContentElement.wizardItems.blog { title = LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_demandedposts.title description = LLL:EXT:blog/Resources/Private/Language/locallang_db.xlf:plugin.blog_demandedposts.description tt_content_defValues { - CType = list - list_type = blog_demandedposts + CType = blog_demandedposts } } } diff --git a/Tests/Functional/Fixtures/Site/tt_content.csv b/Tests/Functional/Fixtures/Site/tt_content.csv index 8048ae12..c4b346c9 100644 --- a/Tests/Functional/Fixtures/Site/tt_content.csv +++ b/Tests/Functional/Fixtures/Site/tt_content.csv @@ -1,7 +1,7 @@ -tt_content,,,, -,uid,pid,CType,list_type -,1,1,list,blog_posts -,2,3,list,blog_category -,3,4,list,blog_tag -,4,5,list,blog_authorposts -,5,6,list,blog_archive +tt_content,,, +,uid,pid,CType +,1,1,blog_posts +,2,3,blog_category +,3,4,blog_tag +,4,5,blog_authorposts +,5,6,blog_archive diff --git a/Tests/Functional/ViewHelpers/Data/ContentListOptionsViewHelperTest.php b/Tests/Functional/ViewHelpers/Data/ContentListOptionsViewHelperTest.php index a2885858..e8464fe3 100644 --- a/Tests/Functional/ViewHelpers/Data/ContentListOptionsViewHelperTest.php +++ b/Tests/Functional/ViewHelpers/Data/ContentListOptionsViewHelperTest.php @@ -30,8 +30,7 @@ public function render(): void $expected = json_encode( [ 'uid' => Constants::LISTTYPE_TO_FAKE_UID_MAPPING['blog_header'], - 'list_type' => 'blog_header', - 'CType' => 'list', + 'CType' => 'blog_header', 'layout' => '0', 'frame_class' => 'default', ], @@ -64,8 +63,7 @@ public function renderWithOverwrite(): void 'space_before_class' => 'small', 'frame_class' => 'secondary', 'uid' => Constants::LISTTYPE_TO_FAKE_UID_MAPPING['blog_header'], - 'list_type' => 'blog_header', - 'CType' => 'list', + 'CType' => 'blog_header', 'layout' => '0', ], JSON_HEX_TAG diff --git a/ext_localconf.php b/ext_localconf.php index c45acc8b..a75ff8be 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -43,7 +43,9 @@ 'Posts', [ PostController::class => 'listRecentPosts', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -51,7 +53,9 @@ 'DemandedPosts', [ PostController::class => 'listByDemand', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -59,7 +63,9 @@ 'LatestPosts', [ PostController::class => 'listLatestPosts', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -67,7 +73,9 @@ 'Category', [ PostController::class => 'listPostsByCategory', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -75,7 +83,9 @@ 'AuthorPosts', [ PostController::class => 'listPostsByAuthor', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -83,7 +93,9 @@ 'Tag', [ PostController::class => 'listPostsByTag', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -91,7 +103,9 @@ 'Archive', [ PostController::class => 'listPostsByDate', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -99,7 +113,9 @@ 'Sidebar', [ PostController::class => 'sidebar', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -110,7 +126,8 @@ ], [ CommentController::class => 'form', - ] + ], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -118,7 +135,9 @@ 'Comments', [ CommentController::class => 'comments', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -126,7 +145,9 @@ 'Header', [ PostController::class => 'header', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -134,7 +155,9 @@ 'Footer', [ PostController::class => 'footer', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -142,7 +165,9 @@ 'Authors', [ PostController::class => 'authors', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -150,7 +175,9 @@ 'RelatedPosts', [ PostController::class => 'relatedPosts', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); // Widgets @@ -159,7 +186,9 @@ 'RecentPostsWidget', [ WidgetController::class => 'recentPosts', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -167,7 +196,9 @@ 'CategoryWidget', [ WidgetController::class => 'categories', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -175,7 +206,9 @@ 'TagWidget', [ WidgetController::class => 'tags', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -183,7 +216,9 @@ 'CommentsWidget', [ WidgetController::class => 'comments', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -191,7 +226,9 @@ 'ArchiveWidget', [ WidgetController::class => 'archive', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); ExtensionUtility::configurePlugin( @@ -199,7 +236,9 @@ 'FeedWidget', [ WidgetController::class => 'feed', - ] + ], + [], + ExtensionUtility::PLUGIN_TYPE_CONTENT_ELEMENT ); // Hooks From 103fd701a53a4f28a87ec84cdbeb8763c50022d4 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Sat, 19 Oct 2024 10:39:20 +0200 Subject: [PATCH 6/9] [TASK] Migrate TypoScript to sets --- Configuration/Sets/Integration/config.yaml | 4 +++ .../Integration/setup.typoscript | 0 Configuration/Sets/Shared/config.yaml | 3 ++ .../Shared/setup.typoscript | 0 Configuration/Sets/Standalone/config.yaml | 5 ++++ .../Standalone/setup.typoscript | 7 ----- Configuration/Sets/Static/config.yaml | 5 ++++ .../Static/constants.typoscript | 0 .../Static/setup.typoscript | 6 ---- .../Integration/constants.typoscript | 4 --- .../Standalone/constants.typoscript | 30 ------------------- 11 files changed, 17 insertions(+), 47 deletions(-) create mode 100644 Configuration/Sets/Integration/config.yaml rename Configuration/{TypoScript => Sets}/Integration/setup.typoscript (100%) create mode 100644 Configuration/Sets/Shared/config.yaml rename Configuration/{TypoScript => Sets}/Shared/setup.typoscript (100%) create mode 100644 Configuration/Sets/Standalone/config.yaml rename Configuration/{TypoScript => Sets}/Standalone/setup.typoscript (90%) create mode 100644 Configuration/Sets/Static/config.yaml rename Configuration/{TypoScript => Sets}/Static/constants.typoscript (100%) rename Configuration/{TypoScript => Sets}/Static/setup.typoscript (99%) delete mode 100644 Configuration/TypoScript/Integration/constants.typoscript delete mode 100644 Configuration/TypoScript/Standalone/constants.typoscript diff --git a/Configuration/Sets/Integration/config.yaml b/Configuration/Sets/Integration/config.yaml new file mode 100644 index 00000000..880c30ec --- /dev/null +++ b/Configuration/Sets/Integration/config.yaml @@ -0,0 +1,4 @@ +name: t3g/blog-integration +label: "TYPO3 Blog: Integration" +dependencies: + - t3g/blog-static diff --git a/Configuration/TypoScript/Integration/setup.typoscript b/Configuration/Sets/Integration/setup.typoscript similarity index 100% rename from Configuration/TypoScript/Integration/setup.typoscript rename to Configuration/Sets/Integration/setup.typoscript diff --git a/Configuration/Sets/Shared/config.yaml b/Configuration/Sets/Shared/config.yaml new file mode 100644 index 00000000..4c220e70 --- /dev/null +++ b/Configuration/Sets/Shared/config.yaml @@ -0,0 +1,3 @@ +name: t3g/blog-shared +label: "TYPO3 Blog: shared" +hidden: true diff --git a/Configuration/TypoScript/Shared/setup.typoscript b/Configuration/Sets/Shared/setup.typoscript similarity index 100% rename from Configuration/TypoScript/Shared/setup.typoscript rename to Configuration/Sets/Shared/setup.typoscript diff --git a/Configuration/Sets/Standalone/config.yaml b/Configuration/Sets/Standalone/config.yaml new file mode 100644 index 00000000..d987bb92 --- /dev/null +++ b/Configuration/Sets/Standalone/config.yaml @@ -0,0 +1,5 @@ +name: t3g/blog-standalone +label: "TYPO3 Blog: Standalone" +dependencies: + - typo3/fluid-styled-content + - t3g/blog-static diff --git a/Configuration/TypoScript/Standalone/setup.typoscript b/Configuration/Sets/Standalone/setup.typoscript similarity index 90% rename from Configuration/TypoScript/Standalone/setup.typoscript rename to Configuration/Sets/Standalone/setup.typoscript index 922673f3..6d301f3f 100644 --- a/Configuration/TypoScript/Standalone/setup.typoscript +++ b/Configuration/Sets/Standalone/setup.typoscript @@ -1,10 +1,3 @@ -###################### -#### DEPENDENCIES #### -###################### -@import "EXT:fluid_styled_content/Configuration/TypoScript/setup.typoscript" -@import "EXT:blog/Configuration/TypoScript/Static/setup.typoscript" -@import "EXT:blog/Configuration/TypoScript/Shared/setup.typoscript" - ################################################ #### DYNAMIC CONTENT LIB FOR USAGE IN FLUID #### ################################################ diff --git a/Configuration/Sets/Static/config.yaml b/Configuration/Sets/Static/config.yaml new file mode 100644 index 00000000..cf961589 --- /dev/null +++ b/Configuration/Sets/Static/config.yaml @@ -0,0 +1,5 @@ +name: t3g/blog-static +label: "TYPO3 Blog: Expert" +dependencies: + - t3g/blog-shared + - typo3/form diff --git a/Configuration/TypoScript/Static/constants.typoscript b/Configuration/Sets/Static/constants.typoscript similarity index 100% rename from Configuration/TypoScript/Static/constants.typoscript rename to Configuration/Sets/Static/constants.typoscript diff --git a/Configuration/TypoScript/Static/setup.typoscript b/Configuration/Sets/Static/setup.typoscript similarity index 99% rename from Configuration/TypoScript/Static/setup.typoscript rename to Configuration/Sets/Static/setup.typoscript index dd15cec9..e7ab4156 100644 --- a/Configuration/TypoScript/Static/setup.typoscript +++ b/Configuration/Sets/Static/setup.typoscript @@ -1,9 +1,3 @@ -###################### -#### DEPENDENCIES #### -###################### -@import "EXT:form/Configuration/TypoScript/setup.typoscript" - - ############## ### PLUGIN ### ############## diff --git a/Configuration/TypoScript/Integration/constants.typoscript b/Configuration/TypoScript/Integration/constants.typoscript deleted file mode 100644 index 7f0f013c..00000000 --- a/Configuration/TypoScript/Integration/constants.typoscript +++ /dev/null @@ -1,4 +0,0 @@ -###################### -#### DEPENDENCIES #### -###################### -@import "EXT:blog/Configuration/TypoScript/Static/constants.typoscript" diff --git a/Configuration/TypoScript/Standalone/constants.typoscript b/Configuration/TypoScript/Standalone/constants.typoscript deleted file mode 100644 index f6bb91ef..00000000 --- a/Configuration/TypoScript/Standalone/constants.typoscript +++ /dev/null @@ -1,30 +0,0 @@ -###################### -#### DEPENDENCIES #### -###################### -@import "EXT:fluid_styled_content/Configuration/TypoScript/constants.typoscript" -@import "EXT:blog/Configuration/TypoScript/Static/constants.typoscript" - -################## -### CATEGORIES ### -################## -# customcategory=blog_standalone=LLL:EXT:blog/Resources/Private/Language/locallang.xlf:constantEditor.customcategory.standalone - -############ -### PAGE ### -############ -page { - fluidtemplate { - # cat=blog_standalone/blog_110_templates; type=string; label=Layout Root Path: Path to layouts - layoutRootPath = EXT:blog/Resources/Private/Layouts/Page/ - # cat=blog_standalone/blog_110_templates; type=string; label=Partial Root Path: Path to partials - partialRootPath = EXT:blog/Resources/Private/Partials/Page/ - # cat=blog_standalone/blog_110_templates; type=string; label=Template Root Path: Path to templates - templateRootPath = EXT:blog/Resources/Private/Templates/Page/ - } - theme { - copyright { - # cat=blog_standalone/blog_110_copyright; type=string; label=Copyright Text - text = Running with TYPO3 and TYPO3 Blog. - } - } -} From f2f0e90f2bff362770352b81ed1e1d4d9982eb5b Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Fri, 25 Oct 2024 08:17:24 +0200 Subject: [PATCH 7/9] [TMP] Generate settings (will be moved into sets) Autogenerated via temporary constant exporter from https://github.com/bnf/typo3/commits/settings-registry-v59/ (not production ready yet) --- .../Sets/Static/settings.definitions.yaml | 835 ++++++++++++++++++ 1 file changed, 835 insertions(+) create mode 100644 Configuration/Sets/Static/settings.definitions.yaml diff --git a/Configuration/Sets/Static/settings.definitions.yaml b/Configuration/Sets/Static/settings.definitions.yaml new file mode 100644 index 00000000..407a3230 --- /dev/null +++ b/Configuration/Sets/Static/settings.definitions.yaml @@ -0,0 +1,835 @@ +categories: + blog: + label: 'TYPO3 Blog' + blog_post: + label: 'TYPO3 Blog: Post' + blog_list: + label: 'TYPO3 Blog: List' + blog_teaser: + label: 'TYPO3 Blog: Teaser' + blog_standalone: + label: 'TYPO3 Blog: Standalone' + blog.blog_110_templates: + label: Templates + parent: blog + blog.blog_100_uids: + label: 'Page ID settings' + parent: blog + blog_post.110_blog_post_header: + label: 'Post Header' + parent: blog_post + blog_post.120_blog_post_footer: + label: 'Post Footer' + parent: blog_post + blog_list.210_blog_list_element_header: + label: 'Element Header' + parent: blog_list + blog_list.220_blog_list_element_footer: + label: 'Element Footer' + parent: blog_list + blog_teaser.310_blog_teaser_element_header: + label: 'Element Header' + parent: blog_teaser + blog_teaser.320_blog_teaser_element_footer: + label: 'Element Footer' + parent: blog_teaser + blog_post.101_blog_post_featuredimage: + label: 'Featured Image' + parent: blog_post + blog_list.100_blog_list_featuredimage: + label: 'Featured Image' + parent: blog_list + blog.blog_120_lists: + label: Listings + parent: blog + blog_teaser.100_blog_list_featuredimage: + label: 'Featured Image' + parent: blog_teaser + blog.blog_120_lists_archive: + label: 'Listings: Archive' + parent: blog + blog.blog_131_widgets_comments: + label: 'Widget: Comment' + parent: blog + blog.blog_132_widgets_recent_posts: + label: 'Widget: Recent posts' + parent: blog + blog.blog_133_widgets_tags: + label: 'Widget: Tags' + parent: blog + blog.blog_134_widgets_archive: + label: 'Widget: Archive' + parent: blog + blog.blog_140_comments: + label: Comments + parent: blog + blog.blog_150_authors: + label: Authors + parent: blog + blog.blog_160_notifications: + label: Notifications + parent: blog + blog_standalone.blog_110_templates: + label: Templates + parent: blog_standalone + blog_standalone.other: + label: Other + parent: blog_standalone +settings: + plugin.tx_blog.view.templateRootPaths: + type: string + default: 'EXT:blog/Resources/Private/Templates/' + label: 'Template Root Path' + description: 'Path to templates folder' + category: blog.blog_110_templates + plugin.tx_blog.view.partialRootPaths: + type: string + default: 'EXT:blog/Resources/Private/Partials/' + label: 'Partial Root Path' + description: 'Path to partial folder' + category: blog.blog_110_templates + plugin.tx_blog.view.layoutRootPaths: + type: string + default: 'EXT:blog/Resources/Private/Layouts/' + label: 'Layout Root Path' + description: 'Path to layout folder' + category: blog.blog_110_templates + plugin.tx_blog.view.emails.templateRootPaths: + type: string + default: 'EXT:blog/Resources/Private/Mails/Templates/' + label: 'Email-Template Root Path' + description: 'Path to templates folder' + category: blog.blog_110_templates + plugin.tx_blog.view.emails.partialRootPaths: + type: string + default: 'EXT:blog/Resources/Private/Mails/Partials/' + label: 'Email-Partial Root Path' + description: 'Path to partial folder' + category: blog.blog_110_templates + plugin.tx_blog.view.emails.layoutRootPaths: + type: string + default: 'EXT:blog/Resources/Private/Mails/Layouts/' + label: 'Email-Layout Root Path' + description: 'Path to layout folder' + category: blog.blog_110_templates + plugin.tx_blog.settings.blogUid: + type: int + default: 0 + label: 'List posts UID' + description: 'Location of the "Blog: List of posts" plugin. This page UID is the root page for the blog. All blog post pages are located below this page.' + category: blog.blog_100_uids + plugin.tx_blog.settings.authorUid: + type: int + default: 0 + label: 'Author UID' + description: 'Location of the "Blog: Author" plugin. Shows posts by author.' + category: blog.blog_100_uids + plugin.tx_blog.settings.categoryUid: + type: int + default: 0 + label: 'List by category UID' + description: 'Location of the "Blog: List by category" plugin. Shows all posts from one category.' + category: blog.blog_100_uids + plugin.tx_blog.settings.tagUid: + type: int + default: 0 + label: 'List by tags UID' + description: 'Location of the "Blog: List by tags" plugin. Shows all posts from one tag.' + category: blog.blog_100_uids + plugin.tx_blog.settings.archiveUid: + type: int + default: 0 + label: 'Archive UID' + description: 'Location of the "Blog: Archive" plugin. Shows archived posts.' + category: blog.blog_100_uids + plugin.tx_blog.settings.storagePid: + type: int + default: 0 + label: 'Storage folder' + description: 'Storage folder of all categories and tags for this blog.' + category: blog.blog_100_uids + plugin.tx_blog.settings.meta.postheader.enable: + type: bool + default: true + label: 'Display meta information in the header' + description: '' + category: blog_post.110_blog_post_header + plugin.tx_blog.settings.meta.postheader.modifier: + type: string + default: simple + label: 'Meta information display style' + description: '' + enum: + simple: simple + condensed: condensed + extended: extended + modern: modern + category: blog_post.110_blog_post_header + plugin.tx_blog.settings.meta.postheader.elements.authors.enable: + type: bool + default: true + label: 'Show authors in the meta section' + description: '' + category: blog_post.110_blog_post_header + plugin.tx_blog.settings.meta.postheader.elements.authors.avatar.enable: + type: bool + default: false + label: 'Enable author avatars in the meta section' + description: '' + category: blog_post.110_blog_post_header + plugin.tx_blog.settings.meta.postheader.elements.authors.avatar.size: + type: int + default: 20 + label: 'Size of the author avatars' + description: 'The size in px for the author avatar' + category: blog_post.110_blog_post_header + plugin.tx_blog.settings.meta.postheader.elements.categories.enable: + type: bool + default: false + label: 'Show categories in the meta section' + description: '' + category: blog_post.110_blog_post_header + plugin.tx_blog.settings.meta.postheader.elements.tags.enable: + type: bool + default: false + label: 'Show tags in the meta section' + description: '' + category: blog_post.110_blog_post_header + plugin.tx_blog.settings.meta.postheader.elements.published.enable: + type: bool + default: true + label: 'Show the publish date in the meta section' + description: '' + category: blog_post.110_blog_post_header + plugin.tx_blog.settings.meta.postheader.elements.published.format: + type: string + default: '%d.%m.%Y' + label: 'Published date format' + description: 'Default: %d.%m.%Y' + category: blog_post.110_blog_post_header + plugin.tx_blog.settings.meta.postheader.elements.comments.enable: + type: bool + default: true + label: 'Show comments in the meta section' + description: '' + category: blog_post.110_blog_post_header + plugin.tx_blog.settings.meta.postfooter.enable: + type: bool + default: true + label: 'Display meta information in the footer' + description: '' + category: blog_post.120_blog_post_footer + plugin.tx_blog.settings.meta.postfooter.modifier: + type: string + default: simple + label: 'Meta information display style' + description: '' + enum: + simple: simple + condensed: condensed + extended: extended + modern: modern + category: blog_post.120_blog_post_footer + plugin.tx_blog.settings.meta.postfooter.elements.authors.enable: + type: bool + default: false + label: 'Show authors in the meta section' + description: '' + category: blog_post.120_blog_post_footer + plugin.tx_blog.settings.meta.postfooter.elements.authors.avatar.enable: + type: bool + default: false + label: 'Enable author avatars in the meta section' + description: '' + category: blog_post.120_blog_post_footer + plugin.tx_blog.settings.meta.postfooter.elements.authors.avatar.size: + type: int + default: 20 + label: 'Size of the author avatars' + description: 'The size in px for the author avatar' + category: blog_post.120_blog_post_footer + plugin.tx_blog.settings.meta.postfooter.elements.categories.enable: + type: bool + default: true + label: 'Show categories in the meta section' + description: '' + category: blog_post.120_blog_post_footer + plugin.tx_blog.settings.meta.postfooter.elements.tags.enable: + type: bool + default: true + label: 'Show tags in the meta section' + description: '' + category: blog_post.120_blog_post_footer + plugin.tx_blog.settings.meta.postfooter.elements.published.enable: + type: bool + default: false + label: 'Show the publish date in the meta section' + description: '' + category: blog_post.120_blog_post_footer + plugin.tx_blog.settings.meta.postfooter.elements.published.format: + type: string + default: '%d.%m.%Y' + label: 'Published date format' + description: 'Default: %d.%m.%Y' + category: blog_post.120_blog_post_footer + plugin.tx_blog.settings.meta.postfooter.elements.comments.enable: + type: bool + default: false + label: 'Show comments in the meta section' + description: '' + category: blog_post.120_blog_post_footer + plugin.tx_blog.settings.meta.listheader.enable: + type: bool + default: true + label: 'Display meta information in the header' + description: '' + category: blog_list.210_blog_list_element_header + plugin.tx_blog.settings.meta.listheader.modifier: + type: string + default: simple + label: 'Meta information display style' + description: '' + enum: + simple: simple + condensed: condensed + extended: extended + modern: modern + category: blog_list.210_blog_list_element_header + plugin.tx_blog.settings.meta.listheader.elements.authors.enable: + type: bool + default: false + label: 'Show authors in the meta section' + description: '' + category: blog_list.210_blog_list_element_header + plugin.tx_blog.settings.meta.listheader.elements.authors.avatar.enable: + type: bool + default: false + label: 'Enable author avatars in the meta section' + description: '' + category: blog_list.210_blog_list_element_header + plugin.tx_blog.settings.meta.listheader.elements.authors.avatar.size: + type: int + default: 20 + label: 'Size of the author avatars' + description: 'The size in px for the author avatar' + category: blog_list.210_blog_list_element_header + plugin.tx_blog.settings.meta.listheader.elements.categories.enable: + type: bool + default: false + label: 'Show categories in the meta section' + description: '' + category: blog_list.210_blog_list_element_header + plugin.tx_blog.settings.meta.listheader.elements.tags.enable: + type: bool + default: false + label: 'Show tags in the meta section' + description: '' + category: blog_list.210_blog_list_element_header + plugin.tx_blog.settings.meta.listheader.elements.published.enable: + type: bool + default: true + label: 'Show the publish date in the meta section' + description: '' + category: blog_list.210_blog_list_element_header + plugin.tx_blog.settings.meta.listheader.elements.published.format: + type: string + default: '%d.%m.%Y' + label: 'Published date format' + description: 'Default: %d.%m.%Y' + category: blog_list.210_blog_list_element_header + plugin.tx_blog.settings.meta.listheader.elements.comments.enable: + type: bool + default: true + label: 'Show comments in the meta section' + description: '' + category: blog_list.210_blog_list_element_header + plugin.tx_blog.settings.meta.listfooter.enable: + type: bool + default: true + label: 'Display meta information in the footer' + description: '' + category: blog_list.220_blog_list_element_footer + plugin.tx_blog.settings.meta.listfooter.modifier: + type: string + default: simple + label: 'Meta information display style' + description: '' + enum: + simple: simple + condensed: condensed + extended: extended + modern: modern + category: blog_list.220_blog_list_element_footer + plugin.tx_blog.settings.meta.listfooter.elements.authors.enable: + type: bool + default: true + label: 'Show authors in the meta section' + description: '' + category: blog_list.220_blog_list_element_footer + plugin.tx_blog.settings.meta.listfooter.elements.authors.avatar.enable: + type: bool + default: false + label: 'Enable author avatars in the meta section' + description: '' + category: blog_list.220_blog_list_element_footer + plugin.tx_blog.settings.meta.listfooter.elements.authors.avatar.size: + type: int + default: 20 + label: 'Size of the author avatars' + description: 'The size in px for the author avatar' + category: blog_list.220_blog_list_element_footer + plugin.tx_blog.settings.meta.listfooter.elements.categories.enable: + type: bool + default: false + label: 'Show categories in the meta section' + description: '' + category: blog_list.220_blog_list_element_footer + plugin.tx_blog.settings.meta.listfooter.elements.tags.enable: + type: bool + default: true + label: 'Show tags in the meta section' + description: '' + category: blog_list.220_blog_list_element_footer + plugin.tx_blog.settings.meta.listfooter.elements.published.enable: + type: bool + default: false + label: 'Show the publish date in the meta section' + description: '' + category: blog_list.220_blog_list_element_footer + plugin.tx_blog.settings.meta.listfooter.elements.published.format: + type: string + default: '%d.%m.%Y' + label: 'Published date format' + description: 'Default: %d.%m.%Y' + category: blog_list.220_blog_list_element_footer + plugin.tx_blog.settings.meta.listfooter.elements.comments.enable: + type: bool + default: false + label: 'Show comments in the meta section' + description: '' + category: blog_list.220_blog_list_element_footer + plugin.tx_blog.settings.meta.teaserheader.enable: + type: bool + default: true + label: 'Display meta information in the header' + description: '' + category: blog_teaser.310_blog_teaser_element_header + plugin.tx_blog.settings.meta.teaserheader.modifier: + type: string + default: simple + label: 'Meta information display style' + description: '' + enum: + simple: simple + condensed: condensed + extended: extended + modern: modern + category: blog_teaser.310_blog_teaser_element_header + plugin.tx_blog.settings.meta.teaserheader.elements.authors.enable: + type: bool + default: true + label: 'Show authors in the meta section' + description: '' + category: blog_teaser.310_blog_teaser_element_header + plugin.tx_blog.settings.meta.teaserheader.elements.authors.avatar.enable: + type: bool + default: false + label: 'Enable author avatars in the meta section' + description: '' + category: blog_teaser.310_blog_teaser_element_header + plugin.tx_blog.settings.meta.teaserheader.elements.authors.avatar.size: + type: int + default: 20 + label: 'Size of the author avatars' + description: 'The size in px for the author avatar' + category: blog_teaser.310_blog_teaser_element_header + plugin.tx_blog.settings.meta.teaserheader.elements.categories.enable: + type: bool + default: false + label: 'Show categories in the meta section' + description: '' + category: blog_teaser.310_blog_teaser_element_header + plugin.tx_blog.settings.meta.teaserheader.elements.tags.enable: + type: bool + default: false + label: 'Show tags in the meta section' + description: '' + category: blog_teaser.310_blog_teaser_element_header + plugin.tx_blog.settings.meta.teaserheader.elements.published.enable: + type: bool + default: true + label: 'Show the publish date in the meta section' + description: '' + category: blog_teaser.310_blog_teaser_element_header + plugin.tx_blog.settings.meta.teaserheader.elements.published.format: + type: string + default: '%d.%m.%Y' + label: 'Published date format' + description: 'Default: %d.%m.%Y' + category: blog_teaser.310_blog_teaser_element_header + plugin.tx_blog.settings.meta.teaserheader.elements.comments.enable: + type: bool + default: false + label: 'Show comments in the meta section' + description: '' + category: blog_teaser.310_blog_teaser_element_header + plugin.tx_blog.settings.meta.teaserfooter.enable: + type: bool + default: false + label: 'Display meta information in the footer' + description: '' + category: blog_teaser.320_blog_teaser_element_footer + plugin.tx_blog.settings.meta.teaserfooter.modifier: + type: string + default: simple + label: 'Meta information display style' + description: '' + enum: + simple: simple + condensed: condensed + extended: extended + modern: modern + category: blog_teaser.320_blog_teaser_element_footer + plugin.tx_blog.settings.meta.teaserfooter.elements.authors.enable: + type: bool + default: false + label: 'Show authors in the meta section' + description: '' + category: blog_teaser.320_blog_teaser_element_footer + plugin.tx_blog.settings.meta.teaserfooter.elements.authors.avatar.enable: + type: bool + default: false + label: 'Enable author avatars in the meta section' + description: '' + category: blog_teaser.320_blog_teaser_element_footer + plugin.tx_blog.settings.meta.teaserfooter.elements.authors.avatar.size: + type: int + default: 20 + label: 'Size of the author avatars' + description: 'The size in px for the author avatar' + category: blog_teaser.320_blog_teaser_element_footer + plugin.tx_blog.settings.meta.teaserfooter.elements.categories.enable: + type: bool + default: false + label: 'Show categories in the meta section' + description: '' + category: blog_teaser.320_blog_teaser_element_footer + plugin.tx_blog.settings.meta.teaserfooter.elements.tags.enable: + type: bool + default: false + label: 'Show tags in the meta section' + description: '' + category: blog_teaser.320_blog_teaser_element_footer + plugin.tx_blog.settings.meta.teaserfooter.elements.published.enable: + type: bool + default: false + label: 'Show the publish date in the meta section' + description: '' + category: blog_teaser.320_blog_teaser_element_footer + plugin.tx_blog.settings.meta.teaserfooter.elements.published.format: + type: string + default: '%d.%m.%Y' + label: 'Published date format' + description: 'Default: %d.%m.%Y' + category: blog_teaser.320_blog_teaser_element_footer + plugin.tx_blog.settings.meta.teaserfooter.elements.comments.enable: + type: bool + default: false + label: 'Show comments in the meta section' + description: '' + category: blog_teaser.320_blog_teaser_element_footer + plugin.tx_blog.settings.post.featuredImage.width: + type: string + default: '1140' + label: Width + description: '' + category: blog_post.101_blog_post_featuredimage + plugin.tx_blog.settings.post.featuredImage.height: + type: string + default: 400c + label: Height + description: '' + category: blog_post.101_blog_post_featuredimage + plugin.tx_blog.settings.lists.featuredImage.width: + type: string + default: '1140' + label: Width + description: '' + category: blog_list.100_blog_list_featuredimage + plugin.tx_blog.settings.lists.featuredImage.height: + type: string + default: 400c + label: Height + description: '' + category: blog_list.100_blog_list_featuredimage + plugin.tx_blog.settings.lists.pagination.itemsPerPage: + type: int + default: 10 + label: 'Number of post that should be displayed per page' + description: '' + category: blog.blog_120_lists + plugin.tx_blog.settings.lists.pagination.insertAbove: + type: int + default: 0 + label: 'Show the pagination above the posts' + description: '' + category: blog.blog_120_lists + plugin.tx_blog.settings.lists.pagination.insertBelow: + type: int + default: 1 + label: 'Show the pagination below the posts' + description: '' + category: blog.blog_120_lists + plugin.tx_blog.settings.lists.pagination.maximumNumberOfLinks: + type: int + default: 10 + label: 'Maximum number of links in the pagination' + description: '' + category: blog.blog_120_lists + plugin.tx_blog.settings.lists.posts.maximumDisplayedItems: + type: int + default: 0 + label: 'Maximum displayed items' + description: 'Maximum number of posts to be displayed (0 = no limit).' + category: blog.blog_120_lists + plugin.tx_blog.settings.lists.posts.dateFormat: + type: string + default: '%d.%m.%Y' + label: 'Date format' + description: 'The format for the list items (default: %d.%m.%Y).' + category: blog.blog_120_lists + plugin.tx_blog.settings.teaser.featuredImage.width: + type: string + default: '1140' + label: Width + description: '' + category: blog_teaser.100_blog_list_featuredimage + plugin.tx_blog.settings.teaser.featuredImage.height: + type: string + default: 400c + label: Height + description: '' + category: blog_teaser.100_blog_list_featuredimage + plugin.tx_blog.settings.archive.showCounter: + type: bool + default: true + label: 'Show counter' + description: 'If enabled, the count of posts is visible (default: 1).' + category: blog.blog_120_lists_archive + plugin.tx_blog.settings.archive.yearDateFormat: + type: string + default: '%Y' + label: 'Year format' + description: 'The format of the year (default: %Y).' + category: blog.blog_120_lists_archive + plugin.tx_blog.settings.archive.monthDateFormat: + type: string + default: '%B' + label: 'Month format' + description: 'The format of the month (default: %B).' + category: blog.blog_120_lists_archive + plugin.tx_blog.settings.latestPosts.limit: + type: int + default: 3 + label: Limit + description: 'The limit of displayed items (default: 3).' + category: blog.blog_120_lists + plugin.tx_blog.settings.relatedPosts.limit: + type: int + default: 4 + label: Limit + description: 'The limit of displayed items (default: 5).' + category: blog.blog_120_lists + plugin.tx_blog.settings.relatedPosts.categoryMultiplier: + type: int + default: 1 + label: 'Category Multiplier' + description: 'The multiplier for categories (default: 1).' + category: blog.blog_120_lists + plugin.tx_blog.settings.relatedPosts.tagMultiplier: + type: int + default: 1 + label: 'Tag Multiplier' + description: 'The multiplier for tags (default: 1).' + category: blog.blog_120_lists + plugin.tx_blog.settings.widgets.comments.limit: + type: int + default: 5 + label: Limit + description: 'The limit of displayed items (default: 5).' + category: blog.blog_131_widgets_comments + plugin.tx_blog.settings.widgets.recentposts.limit: + type: int + default: 5 + label: Limit + description: 'The limit of displayed items (default: 5).' + category: blog.blog_132_widgets_recent_posts + plugin.tx_blog.settings.widgets.tags.limit: + type: int + default: 20 + label: Limit + description: 'The limit of displayed items (default: 20).' + category: blog.blog_133_widgets_tags + plugin.tx_blog.settings.widgets.tags.minSize: + type: int + default: 100 + label: 'Minimum size' + description: 'The minimum size of the font (default: 100).' + category: blog.blog_133_widgets_tags + plugin.tx_blog.settings.widgets.tags.maxSize: + type: int + default: 100 + label: 'Maximum size' + description: 'The maximum size of the font (default: 200).' + category: blog.blog_133_widgets_tags + plugin.tx_blog.settings.widgets.archive.showCounter: + type: bool + default: true + label: 'Show counter' + description: 'If enabled, the count of posts is visible (default: 1).' + category: blog.blog_134_widgets_archive + plugin.tx_blog.settings.widgets.archive.groupByYear: + type: bool + default: true + label: 'Group by year' + description: 'If enabled, the posts are grouped by year (default: 1).' + category: blog.blog_134_widgets_archive + plugin.tx_blog.settings.widgets.archive.groupByMonth: + type: bool + default: true + label: 'Group by month' + description: 'If enabled, the posts are grouped by year and month (default: 1).' + category: blog.blog_134_widgets_archive + plugin.tx_blog.settings.widgets.archive.yearDateFormat: + type: string + default: '%Y' + label: 'Year format' + description: 'The format of the year (default: %Y).' + category: blog.blog_134_widgets_archive + plugin.tx_blog.settings.widgets.archive.monthDateFormat: + type: string + default: '%B' + label: 'Month format' + description: 'The format of the month (default: %B).' + category: blog.blog_134_widgets_archive + plugin.tx_blog.settings.comments.active: + type: bool + default: true + label: 'Enable Comments' + description: 'Activate comments as a general feature' + category: blog.blog_140_comments + plugin.tx_blog.settings.comments.features.urls: + type: bool + default: false + label: 'Enable Urls' + description: 'Activate the url field in the comment form and output the submitted url' + category: blog.blog_140_comments + plugin.tx_blog.settings.comments.moderation: + type: string + default: '0' + label: 'Comments moderation mode' + description: '0 = no moderation, 1 = moderation active, 2 = moderation only on first comment' + enum: + - '0' + - '1' + - '2' + category: blog.blog_140_comments + plugin.tx_blog.settings.comments.respectPostLanguageId: + type: string + default: '1' + label: 'Respect post_language_id' + description: '0 = show all comments also on translated posts, 1 = show only comments written in current language or language all (-1)' + enum: + 0: '0' + 1: '1' + -1: '-1' + category: blog.blog_140_comments + plugin.tx_blog.settings.comments.date.format: + type: string + default: '%B %e, %Y' + label: 'Date format' + description: 'The format for the comments (default: %B %e, %Y).' + category: blog.blog_140_comments + plugin.tx_blog.settings.comments.disqus: + type: bool + default: false + label: 'Enable Disqus' + description: 'Use disqus instead of internal comments?' + category: blog.blog_140_comments + plugin.tx_blog.settings.comments.disqus.shortname: + type: string + default: '' + label: 'Disqus shortname' + description: 'The shortname / forum id of your disqus setup.' + category: blog.blog_140_comments + plugin.tx_blog.settings.comments.google_recaptcha: + type: bool + default: false + label: 'Google Recaptcha v2' + description: 'Enable google recaptcha for comments?' + category: blog.blog_140_comments + plugin.tx_blog.settings.comments.google_recaptcha.website_key: + type: string + default: '' + label: 'Google Recaptcha Website-Key' + description: '' + category: blog.blog_140_comments + plugin.tx_blog.settings.comments.google_recaptcha.secret_key: + type: string + default: '' + label: 'Google Recaptcha Secret-Key' + description: '' + category: blog.blog_140_comments + plugin.tx_blog.settings.authors.avatar.provider.size: + type: int + default: 72 + label: 'Author Avatar Size' + description: 'The size in px for the author avatar' + category: blog.blog_150_authors + plugin.tx_blog.settings.authors.avatar.provider.default: + type: string + default: mm + label: 'Author Avatar Default' + description: 'The default image for an author avatar' + category: blog.blog_150_authors + plugin.tx_blog.settings.authors.avatar.provider.rating: + type: string + default: g + label: 'Define the gravatar rating for images' + description: 'g = suitable for display on all websites with any audience type | pg = may contain rude gestures, provocatively dressed individuals, the lesser swear words, or mild violence | r = may contain such things as harsh profanity, intense violence, nudity, or hard drug use | x = may contain hardcore sexual imagery or extremely disturbing violence.The default image for an author avatar' + enum: + g: g + pg: pg + r: r + x: x + category: blog.blog_150_authors + plugin.tx_blog.settings.notifications.email.senderName: + type: string + default: 'TYPO3 Blog' + label: 'Sender name' + description: 'Global sender name for notifications' + category: blog.blog_160_notifications + plugin.tx_blog.settings.notifications.email.senderMail: + type: string + default: no-reply@example.com + label: 'Sender mail' + description: 'Global sender email address for notifications' + category: blog.blog_160_notifications + plugin.tx_blog.settings.notifications.CommentAddedNotification.author: + type: bool + default: true + label: 'Author notifications' + description: 'Send notification to author of a blog post' + category: blog.blog_160_notifications + plugin.tx_blog.settings.notifications.CommentAddedNotification.admin: + type: bool + default: true + label: 'Admin notifications' + description: 'Send notification to admin of the blog' + category: blog.blog_160_notifications + plugin.tx_blog.settings.notifications.CommentAddedNotification.admin.email: + type: string + default: admin@example.com + label: 'Admin mail' + description: 'Global admin (receiver) email address for notifications' + category: blog.blog_160_notifications From c6393d0b69a1a2d738196f4c542322306815c4ae Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Mon, 4 Nov 2024 09:46:54 +0100 Subject: [PATCH 8/9] [TASK] Replace usage of deprecated TSFE->addCacheTags API --- Classes/Controller/CommentController.php | 2 +- Classes/Controller/PostController.php | 6 ++--- Classes/Controller/WidgetController.php | 8 +++---- Classes/Service/CacheService.php | 29 ++++++++++++------------ Classes/ViewHelpers/CacheViewHelper.php | 4 +++- 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Classes/Controller/CommentController.php b/Classes/Controller/CommentController.php index ed026aab..6964a033 100644 --- a/Classes/Controller/CommentController.php +++ b/Classes/Controller/CommentController.php @@ -48,7 +48,7 @@ public function commentsAction(): ResponseInterface if ($post instanceof Post) { $comments = $this->commentService->getCommentsByPost($post); foreach ($comments as $comment) { - $this->cacheService->addTagToPage('tx_blog_comment_' . $comment->getUid()); + $this->cacheService->addTagToPage($this->request, 'tx_blog_comment_' . $comment->getUid()); } $this->view->assign('comments', $comments); $this->view->assign('post', $post); diff --git a/Classes/Controller/PostController.php b/Classes/Controller/PostController.php index 2adbb042..12560ba4 100644 --- a/Classes/Controller/PostController.php +++ b/Classes/Controller/PostController.php @@ -267,7 +267,7 @@ public function headerAction(): ResponseInterface $post = $this->postRepository->findCurrentPost(); $this->view->assign('post', $post); if ($post instanceof Post) { - $this->blogCacheService->addTagsForPost($post); + $this->blogCacheService->addTagsForPost($this->request, $post); } return $this->htmlResponse(); } @@ -280,7 +280,7 @@ public function footerAction(): ResponseInterface $post = $this->postRepository->findCurrentPost(); $this->view->assign('post', $post); if ($post instanceof Post) { - $this->blogCacheService->addTagsForPost($post); + $this->blogCacheService->addTagsForPost($this->request, $post); } return $this->htmlResponse(); } @@ -293,7 +293,7 @@ public function authorsAction(): ResponseInterface $post = $this->postRepository->findCurrentPost(); $this->view->assign('post', $post); if ($post instanceof Post) { - $this->blogCacheService->addTagsForPost($post); + $this->blogCacheService->addTagsForPost($this->request, $post); } return $this->htmlResponse(); } diff --git a/Classes/Controller/WidgetController.php b/Classes/Controller/WidgetController.php index 4db85af9..590d9f57 100644 --- a/Classes/Controller/WidgetController.php +++ b/Classes/Controller/WidgetController.php @@ -53,7 +53,7 @@ public function categoriesAction(): ResponseInterface $this->view->assign('categories', $categories); $this->view->assign('currentCategory', $currentCategory); foreach ($categories as $category) { - $this->cacheService->addTagToPage('tx_blog_category_' . $category->getUid()); + $this->cacheService->addTagToPage($this->request, 'tx_blog_category_' . $category->getUid()); } return $this->htmlResponse(); } @@ -92,7 +92,7 @@ public function tagsAction(): ResponseInterface } unset($tagReference); foreach ($tags as $tag) { - $this->cacheService->addTagToPage('tx_blog_tag_' . (int)$tag['uid']); + $this->cacheService->addTagToPage($this->request, 'tx_blog_tag_' . (int)$tag['uid']); } $this->view->assign('tags', $tags); $this->view->assign('currentTag', $currentTag); @@ -108,7 +108,7 @@ public function recentPostsAction(): ResponseInterface : $this->postRepository->findAll(); foreach ($posts as $post) { - $this->cacheService->addTagsForPost($post); + $this->cacheService->addTagsForPost($this->request, $post); } $this->view->assign('posts', $posts); return $this->htmlResponse(); @@ -121,7 +121,7 @@ public function commentsAction(): ResponseInterface $comments = $this->commentRepository->findActiveComments($limit, $blogSetup); $this->view->assign('comments', $comments); foreach ($comments as $comment) { - $this->cacheService->addTagToPage('tx_blog_comment_' . $comment->getUid()); + $this->cacheService->addTagToPage($this->request, 'tx_blog_comment_' . $comment->getUid()); } return $this->htmlResponse(); } diff --git a/Classes/Service/CacheService.php b/Classes/Service/CacheService.php index fd87b955..80615f81 100644 --- a/Classes/Service/CacheService.php +++ b/Classes/Service/CacheService.php @@ -10,8 +10,10 @@ namespace T3G\AgencyPack\Blog\Service; +use Psr\Http\Message\ServerRequestInterface; use T3G\AgencyPack\Blog\Domain\Model\Post; use TYPO3\CMS\Core\Cache\CacheManager; +use TYPO3\CMS\Core\Cache\CacheTag; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; @@ -20,31 +22,33 @@ */ class CacheService { - public function addTagsForPost(Post $post): void + public function addTagsForPost(ServerRequestInterface $request, Post $post): void { - $this->addTagToPage('tx_blog_post_' . $post->getUid()); + $this->addTagToPage($request, 'tx_blog_post_' . $post->getUid()); foreach ($post->getAuthors() as $author) { - $this->addTagToPage('tx_blog_author_' . $author->getUid()); + $this->addTagToPage($request, 'tx_blog_author_' . $author->getUid()); } foreach ($post->getCategories() as $category) { - $this->addTagToPage('tx_blog_category_' . $category->getUid()); + $this->addTagToPage($request, 'tx_blog_category_' . $category->getUid()); } foreach ($post->getTags() as $tag) { - $this->addTagToPage('tx_blog_tag_' . $tag->getUid()); + $this->addTagToPage($request, 'tx_blog_tag_' . $tag->getUid()); } foreach ($post->getActiveComments() as $comment) { - $this->addTagToPage('tx_blog_comment_' . $comment->getUid()); + $this->addTagToPage($request, 'tx_blog_comment_' . $comment->getUid()); } } - public function addTagToPage(string $tag): void + public function addTagToPage(ServerRequestInterface $request, string $tag): void { - $this->addTagsToPage([$tag]); + $this->addTagsToPage($request, [$tag]); } - public function addTagsToPage(array $tags): void + public function addTagsToPage(ServerRequestInterface $request, array $tags): void { - $this->getTypoScriptFrontendController()->addCacheTags($tags); + $request->getAttribute('frontend.cache.collector')->addCacheTags( + ...array_map(fn(string $tag) => new CacheTag($tag), $tags) + ); } public function flushCacheByTag(string $tag): void @@ -58,9 +62,4 @@ public function flushCacheByTags(array $tags): void ->getCache('pages') ->flushByTags($tags); } - - protected function getTypoScriptFrontendController(): TypoScriptFrontendController - { - return $GLOBALS['TSFE']; - } } diff --git a/Classes/ViewHelpers/CacheViewHelper.php b/Classes/ViewHelpers/CacheViewHelper.php index 954e1214..fe21f6b0 100644 --- a/Classes/ViewHelpers/CacheViewHelper.php +++ b/Classes/ViewHelpers/CacheViewHelper.php @@ -10,6 +10,7 @@ namespace T3G\AgencyPack\Blog\ViewHelpers; +use Psr\Http\Message\ServerRequestInterface; use T3G\AgencyPack\Blog\Domain\Model\Post; use T3G\AgencyPack\Blog\Service\CacheService; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -25,7 +26,8 @@ public function initializeArguments(): void public function render(): string { $post = $this->arguments['post']; - GeneralUtility::makeInstance(CacheService::class)->addTagsForPost($post); + $request = $this->renderingContext->getAttribute(ServerRequestInterface::class); + GeneralUtility::makeInstance(CacheService::class)->addTagsForPost($request, $post); return ''; } From 8b429e0751d85aecde6d92283554069bb10fd715 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Mon, 4 Nov 2024 10:06:40 +0100 Subject: [PATCH 9/9] [TASK] Replace deprecated fluid RenderingContext::getRequest method --- Classes/ViewHelpers/Link/ArchiveViewHelper.php | 3 ++- Classes/ViewHelpers/Link/AuthorViewHelper.php | 3 ++- Classes/ViewHelpers/Link/CategoryViewHelper.php | 3 ++- Classes/ViewHelpers/Link/PostViewHelper.php | 4 +++- Classes/ViewHelpers/Link/TagViewHelper.php | 3 ++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Classes/ViewHelpers/Link/ArchiveViewHelper.php b/Classes/ViewHelpers/Link/ArchiveViewHelper.php index 0358e4f3..0f04c9d4 100644 --- a/Classes/ViewHelpers/Link/ArchiveViewHelper.php +++ b/Classes/ViewHelpers/Link/ArchiveViewHelper.php @@ -58,9 +58,10 @@ public function render(): string if ($month > 0) { $arguments['month'] = $month; } + $request = $this->renderingContext->getAttribute(ServerRequestInterface::class); $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $uriBuilder->reset() - ->setRequest($this->renderingContext->getRequest()) + ->setRequest($request) ->setTargetPageUid($pageUid); if ($rssFormat) { $uriBuilder diff --git a/Classes/ViewHelpers/Link/AuthorViewHelper.php b/Classes/ViewHelpers/Link/AuthorViewHelper.php index cf40b244..8692ae29 100644 --- a/Classes/ViewHelpers/Link/AuthorViewHelper.php +++ b/Classes/ViewHelpers/Link/AuthorViewHelper.php @@ -68,9 +68,10 @@ protected function buildUriFromDefaultPage(Author $author, bool $rssFormat): str protected function getUriBuilder(int $pageUid, array $additionalParams, bool $rssFormat): UriBuilder { + $request = $this->renderingContext->getAttribute(ServerRequestInterface::class); $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $uriBuilder->reset() - ->setRequest($this->renderingContext->getRequest()) + ->setRequest($request) ->setTargetPageUid($pageUid) ->setArguments($additionalParams); if ($rssFormat) { diff --git a/Classes/ViewHelpers/Link/CategoryViewHelper.php b/Classes/ViewHelpers/Link/CategoryViewHelper.php index abae4609..e89a82fc 100644 --- a/Classes/ViewHelpers/Link/CategoryViewHelper.php +++ b/Classes/ViewHelpers/Link/CategoryViewHelper.php @@ -46,9 +46,10 @@ public function render(): string $arguments = [ 'category' => $category->getUid(), ]; + $request = $this->renderingContext->getAttribute(ServerRequestInterface::class); $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $uriBuilder->reset() - ->setRequest($this->renderingContext->getRequest()) + ->setRequest($request) ->setTargetPageUid($pageUid); if ($rssFormat) { $rssTypeNum = (int)( diff --git a/Classes/ViewHelpers/Link/PostViewHelper.php b/Classes/ViewHelpers/Link/PostViewHelper.php index a72ed8f3..801d8ab5 100644 --- a/Classes/ViewHelpers/Link/PostViewHelper.php +++ b/Classes/ViewHelpers/Link/PostViewHelper.php @@ -10,6 +10,7 @@ namespace T3G\AgencyPack\Blog\ViewHelpers\Link; +use Psr\Http\Message\ServerRequestInterface; use T3G\AgencyPack\Blog\Domain\Model\Post; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder; @@ -41,8 +42,9 @@ public function render(): string $pageUid = (int) $post->getUid(); $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $createAbsoluteUri = (bool)$this->arguments['createAbsoluteUri']; + $request = $this->renderingContext->getAttribute(ServerRequestInterface::class); $uri = $uriBuilder->reset() - ->setRequest($this->renderingContext->getRequest()) + ->setRequest($request) ->setTargetPageUid($pageUid) ->setSection($section) ->setCreateAbsoluteUri($createAbsoluteUri) diff --git a/Classes/ViewHelpers/Link/TagViewHelper.php b/Classes/ViewHelpers/Link/TagViewHelper.php index 333e8d01..95a804ef 100644 --- a/Classes/ViewHelpers/Link/TagViewHelper.php +++ b/Classes/ViewHelpers/Link/TagViewHelper.php @@ -46,9 +46,10 @@ public function render(): string $arguments = [ 'tag' => $tag->getUid(), ]; + $request = $this->renderingContext->getAttribute(ServerRequestInterface::class); $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $uriBuilder->reset() - ->setRequest($this->renderingContext->getRequest()) + ->setRequest($request) ->setTargetPageUid($pageUid); if ($rssFormat) { $rssTypeNum = (int)(