diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e988ec9..fe1ed96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - TYPO3: [ '12', '13', '14' ] + TYPO3: [ '13', '14' ] + php: [ '8.2', '8.5'] steps: - name: Checkout @@ -17,7 +18,7 @@ jobs: - name: Set up PHP Version uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: ${{ matrix.php }} tools: composer:v2 - name: Start MySQL @@ -40,19 +41,12 @@ jobs: if: matrix.TYPO3 == '13' run: | composer require typo3/cms-core:^13.4 --no-progress --no-interaction --dev -W - - name: Install composer dependencies TYPO3 12 - if: matrix.TYPO3 == '12' - run: | - composer require typo3/cms-core:^12.4 --no-progress --no-interaction --dev -W - name: Phpstan 13 if: matrix.TYPO3 == '13' run: .Build/bin/phpstan analyze -c Build/phpstan13.neon - name: Phpstan 14 if: matrix.TYPO3 == '14' run: .Build/bin/phpstan analyze -c Build/phpstan.neon - - name: Phpstan 12 - if: matrix.TYPO3 == '12' - run: .Build/bin/phpstan analyze -c Build/phpstan12.neon - name: Phpcsfix run: .Build/bin/php-cs-fixer fix --config=Build/php-cs-fixer.php --dry-run --stop-on-violation --using-cache=no - name: Functional Tests diff --git a/Build/phpstan-baseline.neon b/Build/phpstan-baseline.neon deleted file mode 100644 index 1de27c9..0000000 --- a/Build/phpstan-baseline.neon +++ /dev/null @@ -1,21 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Parameter \\#1 \\$record of method TYPO3\\\\CMS\\\\Backend\\\\View\\\\Event\\\\PageContentPreviewRenderingEvent\\:\\:setRecord\\(\\) expects TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordInterface, array given\\.$#" - count: 1 - path: ../Classes/Listener/PageContentPreviewRendering.php - - - - message: "#^Parameter \\#1 \\$row of method B13\\\\Listelements\\\\Service\\\\ListService\\:\\:resolveListitems\\(\\) expects array, TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordInterface given\\.$#" - count: 1 - path: ../Classes/Listener/PageContentPreviewRendering.php - - - - message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Core\\\\Domain\\\\Repository\\\\PageRepository\\:\\:enableFields\\(\\)\\.$#" - count: 1 - path: ../Classes/Service/ListService.php - - - - message: "#^Call to an undefined static method TYPO3\\\\CMS\\\\Core\\\\Versioning\\\\VersionState\\:\\:cast\\(\\)\\.$#" - count: 1 - path: ../Classes/Service/ListService.php diff --git a/Build/phpstan.neon b/Build/phpstan.neon index 1d50b1c..657d60e 100644 --- a/Build/phpstan.neon +++ b/Build/phpstan.neon @@ -1,8 +1,6 @@ -includes: - - phpstan-baseline.neon parameters: level: 5 paths: - %currentWorkingDirectory%/Classes excludePaths: - - %currentWorkingDirectory%/Classes/Hooks/DrawItem.php \ No newline at end of file + - %currentWorkingDirectory%/Classes/Listener/PageContentPreviewRendering.php \ No newline at end of file diff --git a/Build/phpstan11.neon b/Build/phpstan11.neon deleted file mode 100644 index b01e92c..0000000 --- a/Build/phpstan11.neon +++ /dev/null @@ -1,9 +0,0 @@ -parameters: - level: 5 - paths: - - %currentWorkingDirectory%/Classes - excludePaths: - - %currentWorkingDirectory%/Classes/Listener/PageContentPreviewRendering.php - ignoreErrors: - - '#Call to an undefined static method TYPO3\\CMS\\Core\\Versioning\\VersionState::tryFrom\(\).#' - - '#Call to an undefined method TYPO3\\CMS\\Core\\Domain\\Repository\\PageRepository::getDefaultConstraints\(\).#' diff --git a/Build/phpstan12.neon b/Build/phpstan12.neon deleted file mode 100644 index cba818e..0000000 --- a/Build/phpstan12.neon +++ /dev/null @@ -1,9 +0,0 @@ -parameters: - level: 5 - paths: - - %currentWorkingDirectory%/Classes - excludePaths: - - %currentWorkingDirectory%/Classes/Hooks/DrawItem.php - ignoreErrors: - - '#Call to an undefined static method TYPO3\\CMS\\Core\\Versioning\\VersionState::tryFrom\(\).#' - - '#Call to an undefined method TYPO3\\CMS\\Core\\Domain\\Repository\\PageRepository::getDefaultConstraints\(\).#' diff --git a/Build/phpstan13.neon b/Build/phpstan13.neon index 1804dd4..5113a15 100644 --- a/Build/phpstan13.neon +++ b/Build/phpstan13.neon @@ -1,6 +1,4 @@ parameters: level: 5 paths: - - %currentWorkingDirectory%/Classes - excludePaths: - - %currentWorkingDirectory%/Classes/Hooks/DrawItem.php \ No newline at end of file + - %currentWorkingDirectory%/Classes \ No newline at end of file diff --git a/Classes/DataProcessing/ListItemsDataProcessor.php b/Classes/DataProcessing/ListItemsDataProcessor.php index 6c89044..5f0b557 100644 --- a/Classes/DataProcessing/ListItemsDataProcessor.php +++ b/Classes/DataProcessing/ListItemsDataProcessor.php @@ -13,20 +13,17 @@ */ use B13\Listelements\Service\ListService; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Frontend\ContentObject\ContentDataProcessor; use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface; +#[Autoconfigure(public: true)] class ListItemsDataProcessor implements DataProcessorInterface { - protected ListService $listService; - protected ContentDataProcessor $contentDataProcessor; - - public function __construct(ListService $listService, ContentDataProcessor $contentDataProcessor) + public function __construct(protected ListService $listService, protected ContentDataProcessor $contentDataProcessor) { - $this->listService = $listService; - $this->contentDataProcessor = $contentDataProcessor; } public function process( diff --git a/Classes/Hooks/DrawItem.php b/Classes/Hooks/DrawItem.php deleted file mode 100644 index bca5836..0000000 --- a/Classes/Hooks/DrawItem.php +++ /dev/null @@ -1,50 +0,0 @@ -listService = $listService; - } - - /** - * @param PageLayoutView $parentObject : The parent object that triggered this hook - * @param bool $drawItem : A switch to tell the parent object, if the item still must be drawn - * @param string $headerContent : The content of the item header - * @param string $itemContent : The content of the item itself - * @param array $row : The current data row for this item - */ - public function preProcess( - PageLayoutView &$parentObject, - &$drawItem, - &$headerContent, - &$itemContent, - array &$row - ) { - // get all list items including all assets - if ($row['tx_listelements_list'] ?? false) { - $row = $this->listService->resolveListitems($row); - } - } -} diff --git a/Classes/Listener/PageContentPreviewRendering.php b/Classes/Listener/PageContentPreviewRendering.php index f36cc66..6ba8321 100644 --- a/Classes/Listener/PageContentPreviewRendering.php +++ b/Classes/Listener/PageContentPreviewRendering.php @@ -14,15 +14,14 @@ use B13\Listelements\Service\ListService; use TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent; +use TYPO3\CMS\Core\Attribute\AsEventListener; use TYPO3\CMS\Core\Information\Typo3Version; +#[AsEventListener(identifier: 'b13-listelements-page-content-preview-rendering')] class PageContentPreviewRendering { - protected ListService $listService; - - public function __construct(ListService $listService) + public function __construct(protected ListService $listService) { - $this->listService = $listService; } public function __invoke(PageContentPreviewRenderingEvent $event): void diff --git a/Classes/Service/ListService.php b/Classes/Service/ListService.php index cfe0db7..6eae46f 100644 --- a/Classes/Service/ListService.php +++ b/Classes/Service/ListService.php @@ -17,13 +17,11 @@ use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\RelationHandler; use TYPO3\CMS\Core\Domain\Repository\PageRepository; -use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Resource\FileRepository; -use TYPO3\CMS\Core\SingletonInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Versioning\VersionState; -class ListService implements SingletonInterface +class ListService { private const TABLE = 'tx_listelements_item'; @@ -79,9 +77,6 @@ public function resolveListitems(array $row, string $field = 'tx_listelements_li protected function isDeletePlaceHolder(array $item): bool { - if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 13) { - return VersionState::cast($item['t3ver_state'] ?? 0)->equals(VersionState::DELETE_PLACEHOLDER); - } return VersionState::tryFrom($item['t3ver_state'] ?? 0) === VersionState::DELETE_PLACEHOLDER; } @@ -91,18 +86,14 @@ public function resolveItemsForFrontend(int $uid, string $table = 'tt_content', $pageRepository = GeneralUtility::makeInstance(PageRepository::class); $relationHandler = GeneralUtility::makeInstance(RelationHandler::class); $relationHandler->setWorkspaceId($workspaceId); - if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 13) { - $additionalWhere = $pageRepository->enableFields(self::TABLE); + $constraints = $pageRepository->getDefaultConstraints(self::TABLE); + if ($constraints === []) { + $additionalWhere = ''; } else { - $constraints = $pageRepository->getDefaultConstraints(self::TABLE); - if ($constraints === []) { - $additionalWhere = ''; - } else { - $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class) - ->getQueryBuilderForTable($table) - ->expr(); - $additionalWhere = ' AND ' . $expressionBuilder->and(...$constraints); - } + $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class) + ->getQueryBuilderForTable($table) + ->expr(); + $additionalWhere = ' AND ' . $expressionBuilder->and(...$constraints); } $relationHandler->additionalWhere[self::TABLE] = $additionalWhere; $relationHandler->start( diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index 70aad55..6e7df6b 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -6,13 +6,3 @@ services: B13\Listelements\: resource: '../Classes/*' - - B13\Listelements\Hooks\DrawItem: - public: true - B13\Listelements\DataProcessing\ListItemsDataProcessor: - public: true - B13\Listelements\Listener\PageContentPreviewRendering: - tags: - - name: event.listener - event: TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent - identifier: 'b13-listelements-page-content-preview-rendering' diff --git a/Configuration/Sets/listelements/setup.typoscript b/Configuration/Sets/listelements/setup.typoscript index b440796..ef610c0 100644 --- a/Configuration/Sets/listelements/setup.typoscript +++ b/Configuration/Sets/listelements/setup.typoscript @@ -22,3 +22,5 @@ lib.contentElement { } } } + +# not required if you use record-transformation dataProcessing, s. README.md \ No newline at end of file diff --git a/Configuration/TCA/Overrides/sys_template.php b/Configuration/TCA/Overrides/sys_template.php deleted file mode 100644 index 719fa6c..0000000 --- a/Configuration/TCA/Overrides/sys_template.php +++ /dev/null @@ -1,5 +0,0 @@ - [ - 'showitem' => ' - --palette--;;basicoverlayPalette, - --palette--;;filePalette', - ], - (enum_exists(\TYPO3\CMS\Core\Resource\FileType::class) ? \TYPO3\CMS\Core\Resource\FileType::TEXT->value : \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT) => [ - 'showitem' => ' - --palette--;;imageoverlayPalette, - --palette--;;filePalette', - ], - (enum_exists(\TYPO3\CMS\Core\Resource\FileType::class) ? \TYPO3\CMS\Core\Resource\FileType::IMAGE->value : \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE) => [ - 'showitem' => ' - --palette--;;imageoverlayPalette, - --palette--;;filePalette', - ], - (enum_exists(\TYPO3\CMS\Core\Resource\FileType::class) ? \TYPO3\CMS\Core\Resource\FileType::AUDIO->value : \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO) => [ - 'showitem' => ' - --palette--;;audioOverlayPalette, - --palette--;;filePalette', - ], - (enum_exists(\TYPO3\CMS\Core\Resource\FileType::class) ? \TYPO3\CMS\Core\Resource\FileType::VIDEO->value : \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO) => [ - 'showitem' => ' - --palette--;;videoOverlayPalette, - --palette--;;filePalette', - ], - (enum_exists(\TYPO3\CMS\Core\Resource\FileType::class) ? \TYPO3\CMS\Core\Resource\FileType::APPLICATION->value : \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION) => [ - 'showitem' => ' - --palette--;;basicoverlayPalette, - --palette--;;filePalette', - ], - ]; - if ((\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Information\Typo3Version::class))->getMajorVersion() < 12) { - $GLOBALS['TCA']['tx_listelements_item']['ctrl']['cruser_id'] = 'cruser_id'; - $GLOBALS['TCA']['tx_listelements_item']['columns']['l10n_parent']['config']['internal_type'] = 'db'; - $GLOBALS['TCA']['tx_listelements_item']['columns']['sorting_foreign']['config']['type'] = 'input'; - $GLOBALS['TCA']['tx_listelements_item']['columns']['sorting_foreign']['config']['eval'] = 'int'; - $GLOBALS['TCA']['tx_listelements_item']['columns']['sorting_foreign']['config']['internal_type'] = 'db'; - $GLOBALS['TCA']['tx_listelements_item']['columns']['images']['config'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( - 'images', - [ - 'appearance' => [ - 'createNewRelationLinkTitle' => 'LLL:EXT:listelements/Resources/Private/Language/locallang_db.xlf:tx_listelements_item.images.addFileReference', - ], - // custom configuration for displaying fields in the overlay/reference table - // to use the imageoverlayPalette instead of the basicoverlayPalette - 'overrideChildTca' => [ - 'types' => $childTcaTypes, - ], - ] - ); - $GLOBALS['TCA']['tx_listelements_item']['columns']['assets']['config'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( - 'assets', - [ - 'appearance' => [ - 'createNewRelationLinkTitle' => 'LLL:EXT:listelements/Resources/Private/Language/locallang_db.xlf:tx_listelements_item.assets.addFileReference', - ], - // custom configuration for displaying fields in the overlay/reference table - // to use the imageoverlayPalette instead of the basicoverlayPalette - 'overrideChildTca' => [ - 'types' => $childTcaTypes, - ], - ] - ); - $GLOBALS['TCA']['tx_listelements_item']['columns']['link']['config'] = [ - 'type' => 'input', - 'renderType' => 'inputLink', - 'size' => 50, - 'max' => 1024, - 'eval' => 'trim', - 'fieldControl' => [ - 'linkPopup' => [ - 'options' => [ - 'title' => 'LLL:EXT:listelements/Resources/Private/Language/locallang_db.xlf:tx_listelements_item.link', - ], - ], - ], - 'softref' => 'typolink', - ]; + $majorVersion = (new \TYPO3\CMS\Core\Information\Typo3Version())->getMajorVersion(); + if ($majorVersion < 14) { + $GLOBALS['TCA']['tx_listelements_item']['ctrl']['searchFields'] = 'header,subheader,bodytext,link'; } else { - $GLOBALS['TCA']['tx_listelements_item']['columns']['assets']['config']['overrideChildTca']['types'] = $childTcaTypes; - $GLOBALS['TCA']['tx_listelements_item']['columns']['images']['config']['overrideChildTca']['types'] = $childTcaTypes; + // https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/14.0/Breaking-106972-TCAControlOptionSearchFieldsRemoved.html + // the Schema API detects searchable fields (e.g. all type text or input + // we exclude: + $GLOBALS['TCA']['tx_listelements_item']['columns']['tablename']['config']['searchable'] = false; + $GLOBALS['TCA']['tx_listelements_item']['columns']['fieldname']['config']['searchable'] = false; } })(); diff --git a/Configuration/TCA/tx_listelements_item.php b/Configuration/TCA/tx_listelements_item.php index bfaee00..8988950 100644 --- a/Configuration/TCA/tx_listelements_item.php +++ b/Configuration/TCA/tx_listelements_item.php @@ -27,7 +27,6 @@ 'ignoreRootLevelRestriction' => true, 'ignorePageTypeRestriction' => true, ], - 'searchFields' => 'header,subheader,bodytext,link', ], 'columns' => [ @@ -164,6 +163,40 @@ 'createNewRelationLinkTitle' => 'LLL:EXT:listelements/Resources/Private/Language/locallang_db.xlf:tx_listelements_item.images.addFileReference', ], 'allowed' => 'common-image-types', + 'overrideChildTca' => [ + 'types' => [ + 0 => [ + 'showitem' => ' + --palette--;;basicoverlayPalette, + --palette--;;filePalette', + ], + \TYPO3\CMS\Core\Resource\FileType::TEXT->value => [ + 'showitem' => ' + --palette--;;imageoverlayPalette, + --palette--;;filePalette', + ], + \TYPO3\CMS\Core\Resource\FileType::IMAGE->value => [ + 'showitem' => ' + --palette--;;imageoverlayPalette, + --palette--;;filePalette', + ], + \TYPO3\CMS\Core\Resource\FileType::AUDIO->value => [ + 'showitem' => ' + --palette--;;audioOverlayPalette, + --palette--;;filePalette', + ], + \TYPO3\CMS\Core\Resource\FileType::VIDEO->value => [ + 'showitem' => ' + --palette--;;videoOverlayPalette, + --palette--;;filePalette', + ], + \TYPO3\CMS\Core\Resource\FileType::APPLICATION->value => [ + 'showitem' => ' + --palette--;;basicoverlayPalette, + --palette--;;filePalette', + ], + ], + ], ], ], 'assets' => [ @@ -173,6 +206,40 @@ 'appearance' => [ 'createNewRelationLinkTitle' => 'LLL:EXT:listelements/Resources/Private/Language/locallang_db.xlf:tx_listelements_item.assets.addFileReference', ], + 'overrideChildTca' => [ + 'types' => [ + 0 => [ + 'showitem' => ' + --palette--;;basicoverlayPalette, + --palette--;;filePalette', + ], + \TYPO3\CMS\Core\Resource\FileType::TEXT->value => [ + 'showitem' => ' + --palette--;;imageoverlayPalette, + --palette--;;filePalette', + ], + \TYPO3\CMS\Core\Resource\FileType::IMAGE->value => [ + 'showitem' => ' + --palette--;;imageoverlayPalette, + --palette--;;filePalette', + ], + \TYPO3\CMS\Core\Resource\FileType::AUDIO->value => [ + 'showitem' => ' + --palette--;;audioOverlayPalette, + --palette--;;filePalette', + ], + \TYPO3\CMS\Core\Resource\FileType::VIDEO->value => [ + 'showitem' => ' + --palette--;;videoOverlayPalette, + --palette--;;filePalette', + ], + \TYPO3\CMS\Core\Resource\FileType::APPLICATION->value => [ + 'showitem' => ' + --palette--;;basicoverlayPalette, + --palette--;;filePalette', + ], + ], + ], ], ], 'link' => [ diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript deleted file mode 100644 index 1380e62..0000000 --- a/Configuration/TypoScript/setup.typoscript +++ /dev/null @@ -1 +0,0 @@ -@import 'EXT:listelements/Configuration/Sets/listelements/setup.typoscript' \ No newline at end of file diff --git a/README.md b/README.md index c1c02a1..d894ec6 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,33 @@ content element's Fluid template, like this: ``` +### alternative: record-transformation dataProcessing + +if you use record-transformation dataProcessing for your content-elements the EXT:listelements Site-Set (the TypoScript) is not required +you can do + + tt_content..dataProcessing.10 = record-transformation + +then you have adapt your templates, e.g. + +``` + + ... + +``` + +and also the items self, e.g. + + {item.header} + {item.images} + +instead of + + {item.data.header} + {item.listimages} + +s. https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/DataProcessing/RecordTransformationProcessor.html + ## Backend PageLayoutView preview This extension adds a PageContentPreviewRendering Listener to resolve ListItems (and if needed further Relations to asses/images) to allow customized display using Fluid templates for the backend Page diff --git a/Tests/Functional/Fixture/Extensions/listelements-example/Configuration/TCA/Overrides/pages.php b/Tests/Functional/Fixture/Extensions/listelements-example/Configuration/TCA/Overrides/pages.php index 25ae9dc..bd1b5dd 100644 --- a/Tests/Functional/Fixture/Extensions/listelements-example/Configuration/TCA/Overrides/pages.php +++ b/Tests/Functional/Fixture/Extensions/listelements-example/Configuration/TCA/Overrides/pages.php @@ -16,7 +16,6 @@ 'showSynchronizationLink' => false, 'showAllLocalizationLink' => true, 'showPossibleLocalizationRecords' => true, - 'showRemovedLocalizationRecords' => true, 'expandSingle' => true, 'newRecordLinkAddTitle' => false, 'newRecordLinkTitle' => 'LLL:EXT:listelements/Resources/Private/Language/locallang_db.xlf:tt_content.list.newRecordLinkAddTitle', diff --git a/Tests/Functional/Fixture/Extensions/listelements-example/Configuration/TypoScript/setup.typoscript b/Tests/Functional/Fixture/Extensions/listelements-example/Configuration/TypoScript/setup.typoscript index f439db0..32a3850 100644 --- a/Tests/Functional/Fixture/Extensions/listelements-example/Configuration/TypoScript/setup.typoscript +++ b/Tests/Functional/Fixture/Extensions/listelements-example/Configuration/TypoScript/setup.typoscript @@ -1,6 +1,6 @@ @import 'EXT:fluid_styled_content/Configuration/TypoScript/setup.typoscript' -@import 'EXT:listelements/Configuration/TypoScript/setup.typoscript' +@import 'EXT:listelements/Configuration/Sets/listelements/setup.typoscript' tt_content.header { templateName = Header diff --git a/Tests/Functional/Frontend/FrontendTest.php b/Tests/Functional/Frontend/FrontendTest.php index 846ccc3..66da783 100644 --- a/Tests/Functional/Frontend/FrontendTest.php +++ b/Tests/Functional/Frontend/FrontendTest.php @@ -12,6 +12,7 @@ * of the License, or any later version. */ +use PHPUnit\Framework\Attributes\Test; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequestContext; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -38,9 +39,7 @@ class FrontendTest extends FunctionalTestCase 'listelements_example', ]; - /** - * @test - */ + #[Test] public function itemIsRendered(): void { $this->importCSVDataSet(__DIR__ . '/../Fixture/single_element.csv'); @@ -57,9 +56,7 @@ public function itemIsRendered(): void self::assertStringContainsString('listitem-header', $body); } - /** - * @test - */ + #[Test] public function workspaceItemIsRenderedInWorkspace(): void { $this->importCSVDataSet(__DIR__ . '/../Fixture/workspace.csv'); @@ -81,9 +78,7 @@ public function workspaceItemIsRenderedInWorkspace(): void self::assertStringNotContainsString('listitem-header', $body); } - /** - * @test - */ + #[Test] public function worspaceItemIsNotRenderedInNonWorkspace(): void { $this->importCSVDataSet(__DIR__ . '/../Fixture/workspace.csv'); @@ -104,9 +99,7 @@ public function worspaceItemIsNotRenderedInNonWorkspace(): void self::assertStringContainsString('listitem-header', $body); } - /** - * @test - */ + #[Test] public function workspaceItemsIsRenderedInCorrectOrderInWorkspace(): void { $this->importCSVDataSet(__DIR__ . '/../Fixture/workspace.csv'); @@ -127,9 +120,7 @@ public function workspaceItemsIsRenderedInCorrectOrderInWorkspace(): void self::assertStringContainsString('first item header-listelement-ws', $body); } - /** - * @test - */ + #[Test] public function deletedworkspaceItemIsNotRenderedInWorkspace(): void { $this->importCSVDataSet(__DIR__ . '/../Fixture/workspace.csv'); @@ -150,9 +141,7 @@ public function deletedworkspaceItemIsNotRenderedInWorkspace(): void self::assertStringNotContainsString('listitem-header', $body); } - /** - * @test - */ + #[Test] public function pageItemIsRendered(): void { $this->importCSVDataSet(__DIR__ . '/../Fixture/page.csv'); diff --git a/Tests/Functional/Service/ListServiceTest.php b/Tests/Functional/Service/ListServiceTest.php index 9498c63..5486e9b 100644 --- a/Tests/Functional/Service/ListServiceTest.php +++ b/Tests/Functional/Service/ListServiceTest.php @@ -13,6 +13,7 @@ */ use B13\Listelements\Service\ListService; +use PHPUnit\Framework\Attributes\Test; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Context\WorkspaceAspect; @@ -37,9 +38,7 @@ class ListServiceTest extends FunctionalTestCase 'listelements', ]; - /** - * @test - */ + #[Test] public function itemIsFound(): void { $this->importCSVDataSet(__DIR__ . '/../Fixture/single_element.csv'); @@ -51,9 +50,7 @@ public function itemIsFound(): void self::assertSame('listitem-header', $row['listitems'][0]['header']); } - /** - * @test - */ + #[Test] public function workspaceItemIsFoundInWorkspace(): void { $this->importCSVDataSet(__DIR__ . '/../Fixture/workspace.csv'); @@ -67,9 +64,7 @@ public function workspaceItemIsFoundInWorkspace(): void self::assertSame('header-listelement-ws', $row['listitems'][0]['header']); } - /** - * @test - */ + #[Test] public function liveItemIsFoundInNonWorkspace(): void { $this->importCSVDataSet(__DIR__ . '/../Fixture/workspace.csv'); @@ -82,9 +77,7 @@ public function liveItemIsFoundInNonWorkspace(): void self::assertSame('listitem-header', $row['listitems'][0]['header']); } - /** - * @test - */ + #[Test] public function deletedWorkspaceItemsAreNotListedInWorkspace(): void { $this->importCSVDataSet(__DIR__ . '/../Fixture/workspace.csv'); @@ -96,9 +89,7 @@ public function deletedWorkspaceItemsAreNotListedInWorkspace(): void self::assertSame(0, count($row['listitems'])); } - /** - * @test - */ + #[Test] public function workspaceItemsHasCorrectOrderInWorkspace(): void { $this->importCSVDataSet(__DIR__ . '/../Fixture/workspace.csv'); diff --git a/composer.json b/composer.json index bd144b4..0464fa6 100644 --- a/composer.json +++ b/composer.json @@ -6,9 +6,8 @@ "GPL-2.0-or-later" ], "require": { - "php": "^7.4 || ~8.0", - "typo3/cms-backend": "^11.5 || ^12.4 || ^13.1 || ^14.0", - "typo3/cms-fluid-styled-content": "^11.5 || ^12.4 || ^13.1 || ^14.0" + "typo3/cms-backend": "^13.4 || ^14.1", + "typo3/cms-fluid-styled-content": "^13.4 || ^14.1" }, "extra": { "typo3/cms": { @@ -21,12 +20,11 @@ "minimum-stability": "dev", "prefer-stable": true, "require-dev": { - "typo3/testing-framework": "^7.0 || ^8.0 || ^9.1", - "typo3/cms-frontend": "^11.5 || ^12.4 || ^13.1 || ^14.0", - "typo3/cms-workspaces": "^11.5 || ^12.4 || ^13.1 || ^14.0", + "typo3/testing-framework": "^9.1", + "typo3/cms-frontend": "^13.4 || ^14.1", + "typo3/cms-workspaces": "^13.4 || ^14.1", "phpstan/phpstan": "^1.10", "typo3/coding-standards": "^0.5.5", - "phpunit/phpunit": "9.6 || ^10.5 || ^11.3", "b13/listelements-example": "*" }, "autoload-dev": { diff --git a/ext_emconf.php b/ext_emconf.php index bce4571..ea3f288 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -11,7 +11,7 @@ 'author_company' => 'b13 GmbH, Stuttgart', 'constraints' => [ 'depends' => [ - 'typo3' => '11.5.0-14.99.99', + 'typo3' => '13.4.0-14.99.99', ], ], ]; diff --git a/ext_localconf.php b/ext_localconf.php deleted file mode 100644 index d1cce46..0000000 --- a/ext_localconf.php +++ /dev/null @@ -1,11 +0,0 @@ -getMajorVersion() < 12) { - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem'][] = \B13\Listelements\Hooks\DrawItem::class; - // else PageContentPreviewRendering Listener is used - } -})(); diff --git a/ext_tables.php b/ext_tables.php deleted file mode 100644 index 0f3961c..0000000 --- a/ext_tables.php +++ /dev/null @@ -1,9 +0,0 @@ -getMajorVersion() < 12) { - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_listelements_item'); - } -})();