diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e0c807..8c51e40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - TYPO3: [ '12', '13', '14' ] + TYPO3: [ '13', '14' ] steps: - name: Checkout @@ -37,10 +37,6 @@ jobs: if: matrix.TYPO3 == '13' run: | composer require typo3/cms-core:^13.4 typo3/cms-fluid:^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 typo3/cms-extbase:^12.4 typo3/cms-fluid:^12.4 --no-progress --no-interaction --dev -W - name: Phpcsfix run: .Build/bin/php-cs-fixer fix --config=Build/php-cs-fixer.php --dry-run --stop-on-violation --using-cache=no - name: Phpstan 13 @@ -48,7 +44,4 @@ jobs: 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 \ No newline at end of file + run: .Build/bin/phpstan analyze -c Build/phpstan.neon \ No newline at end of file diff --git a/Build/phpstan-baseline.neon b/Build/phpstan-baseline.neon index b4fa326..967d5ac 100644 --- a/Build/phpstan-baseline.neon +++ b/Build/phpstan-baseline.neon @@ -1,45 +1,5 @@ parameters: ignoreErrors: - - - message: "#^Call to method assignMultiple\\(\\) on an unknown class TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView\\.$#" - count: 1 - path: ../Classes/Backend/Preview/ContentPreview.php - - - - message: "#^Call to method hasTemplate\\(\\) on an unknown class TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView\\.$#" - count: 1 - path: ../Classes/Backend/Preview/ContentPreview.php - - - - message: "#^Call to method render\\(\\) on an unknown class TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView\\.$#" - count: 1 - path: ../Classes/Backend/Preview/ContentPreview.php - - - - message: "#^Call to method setLayoutRootPaths\\(\\) on an unknown class TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView\\.$#" - count: 1 - path: ../Classes/Backend/Preview/ContentPreview.php - - - - message: "#^Call to method setPartialRootPaths\\(\\) on an unknown class TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView\\.$#" - count: 1 - path: ../Classes/Backend/Preview/ContentPreview.php - - - - message: "#^Call to method setTemplate\\(\\) on an unknown class TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView\\.$#" - count: 1 - path: ../Classes/Backend/Preview/ContentPreview.php - - - - message: "#^Call to method setTemplateRootPaths\\(\\) on an unknown class TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView\\.$#" - count: 1 - path: ../Classes/Backend/Preview/ContentPreview.php - - - - message: "#^Class TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView not found\\.$#" - count: 1 - path: ../Classes/Backend/Preview/ContentPreview.php - - message: "#^Else branch is unreachable because previous condition is always true\\.$#" count: 1 @@ -54,12 +14,3 @@ parameters: message: "#^Parameter \\#1 \\$row of method B13\\\\Backendpreviews\\\\Service\\\\DatabaseRowService\\:\\:extendRow\\(\\) expects array, TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordInterface given\\.$#" count: 1 path: ../Classes/Listener/PageContentPreviewRendering.php - - - - message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Core\\\\Database\\\\Query\\\\QueryBuilder\\:\\:add\\(\\)\\.$#" - count: 1 - path: ../Classes/ViewHelpers/GetDatabaseRecordViewHelper.php - - - message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Imaging\\\\IconProvider\\\\FontawesomeIconProvider not found\\.$#" - count: 2 - path: ../Classes/Listener/BootCompleted.php diff --git a/Build/phpstan-baseline12.neon b/Build/phpstan-baseline12.neon deleted file mode 100644 index c3a7f0a..0000000 --- a/Build/phpstan-baseline12.neon +++ /dev/null @@ -1,87 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Backend\\\\View\\\\PageLayoutContext\\:\\:getCurrentRequest\\(\\)\\.$#" - count: 1 - path: ../Classes/Backend/Preview/ContentPreview.php - - - - message: "#^Call to method create\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\View\\\\ViewFactoryInterface\\.$#" - count: 1 - path: ../Classes/Backend/Preview/ContentPreview.php - - - - message: "#^Call to method getPid\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordInterface\\.$#" - count: 1 - path: ../Classes/Backend/Preview/ContentPreview.php - - - - message: "#^Call to method getRecordType\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordInterface\\.$#" - count: 1 - path: ../Classes/Backend/Preview/ContentPreview.php - - - - message: "#^Class TYPO3\\\\CMS\\\\Core\\\\View\\\\ViewFactoryInterface not found\\.$#" - count: 1 - path: ../Classes/Backend/Preview/ContentPreview.php - - - - message: "#^Instantiated class TYPO3\\\\CMS\\\\Core\\\\View\\\\ViewFactoryData not found\\.$#" - count: 1 - path: ../Classes/Backend/Preview/ContentPreview.php - - - - message: "#^Parameter \\$record of method B13\\\\Backendpreviews\\\\Backend\\\\Preview\\\\ContentPreview\\:\\:render\\(\\) has invalid type TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordInterface\\.$#" - count: 1 - path: ../Classes/Backend/Preview/ContentPreview.php - - - - message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordInterface not found\\.$#" - count: 1 - path: ../Classes/Backend/Preview/StandardContentPreviewRenderer.php - - - - message: "#^Instanceof between array and TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordInterface will always evaluate to false\\.$#" - count: 1 - path: ../Classes/Backend/Preview/StandardContentPreviewRenderer.php - - - message: "#^Call to method get\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordInterface\\.$#" - count: 1 - path: ../Classes/Service/DatabaseRowService.php - - - - message: "#^Call to method getMainType\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordInterface\\.$#" - count: 2 - path: ../Classes/Service/DatabaseRowService.php - - - - message: "#^Call to method getPid\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordInterface\\.$#" - count: 1 - path: ../Classes/Service/DatabaseRowService.php - - - - message: "#^Call to method getRawRecord\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordInterface\\.$#" - count: 1 - path: ../Classes/Service/DatabaseRowService.php - - - - message: "#^Call to method getUid\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordInterface\\.$#" - count: 4 - path: ../Classes/Service/DatabaseRowService.php - - - message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Core\\\\Authentication\\\\BackendUserAuthentication\\:\\:checkRecordEditAccess\\(\\)\\.$#" - count: 1 - path: ../Classes/Service/DatabaseRowService.php - - - - message: "#^Parameter \\$record of method B13\\\\Backendpreviews\\\\Service\\\\DatabaseRowService\\:\\:getAdditionalDataForView\\(\\) has invalid type TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordInterface\\.$#" - count: 1 - path: ../Classes/Service/DatabaseRowService.php - - - message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Imaging\\\\IconProvider\\\\FontawesomeIconProvider not found\\.$#" - count: 2 - path: ../Classes/Listener/BootCompleted.php - - - message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Backend\\\\View\\\\PageLayoutContext\\:\\:getReturnUrl\\(\\)\\.$#" - count: 1 - path: ../Classes/Service/DatabaseRowService.php \ No newline at end of file diff --git a/Build/phpstan-baseline13.neon b/Build/phpstan-baseline13.neon index cd5a79f..e4987ad 100644 --- a/Build/phpstan-baseline13.neon +++ b/Build/phpstan-baseline13.neon @@ -8,11 +8,3 @@ parameters: message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Core\\\\Authentication\\\\BackendUserAuthentication\\:\\:checkRecordEditAccess\\(\\)\\.$#" count: 1 path: ../Classes/Service/DatabaseRowService.php - - - message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Core\\\\Database\\\\Query\\\\QueryBuilder\\:\\:add\\(\\)\\.$#" - count: 1 - path: ../Classes/ViewHelpers/GetDatabaseRecordViewHelper.php - - - message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Imaging\\\\IconProvider\\\\FontawesomeIconProvider not found\\.$#" - count: 2 - path: ../Classes/Listener/BootCompleted.php diff --git a/Build/phpstan.neon b/Build/phpstan.neon index d27b0d2..34cb13a 100644 --- a/Build/phpstan.neon +++ b/Build/phpstan.neon @@ -3,6 +3,4 @@ includes: parameters: level: 5 paths: - - %currentWorkingDirectory%/Classes - excludePaths: - - %currentWorkingDirectory%/Classes/Hooks/BackendPreviewRenderer.php \ No newline at end of file + - %currentWorkingDirectory%/Classes \ No newline at end of file diff --git a/Build/phpstan12.neon b/Build/phpstan12.neon deleted file mode 100644 index 2ec6711..0000000 --- a/Build/phpstan12.neon +++ /dev/null @@ -1,8 +0,0 @@ -includes: - - phpstan-baseline12.neon -parameters: - level: 5 - paths: - - %currentWorkingDirectory%/Classes - excludePaths: - - %currentWorkingDirectory%/Classes/Hooks/BackendPreviewRenderer.php \ No newline at end of file diff --git a/Build/phpstan13.neon b/Build/phpstan13.neon index 0ebc213..27c0da6 100644 --- a/Build/phpstan13.neon +++ b/Build/phpstan13.neon @@ -3,6 +3,4 @@ includes: parameters: level: 5 paths: - - %currentWorkingDirectory%/Classes - excludePaths: - - %currentWorkingDirectory%/Classes/Hooks/BackendPreviewRenderer.php \ No newline at end of file + - %currentWorkingDirectory%/Classes \ No newline at end of file diff --git a/Classes/Backend/Preview/ContentPreview.php b/Classes/Backend/Preview/ContentPreview.php index 2468ab1..7723444 100644 --- a/Classes/Backend/Preview/ContentPreview.php +++ b/Classes/Backend/Preview/ContentPreview.php @@ -19,43 +19,23 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\View\ViewFactoryData; use TYPO3\CMS\Core\View\ViewFactoryInterface; -use TYPO3\CMS\Fluid\View\StandaloneView; +use TYPO3\CMS\Core\View\ViewInterface; use TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException; class ContentPreview { public function render(RecordInterface $record, PageLayoutContext $context): ?string { - $previewConfiguration = BackendUtility::getPagesTSconfig($record->getPid())['mod.']['web_layout.']['tt_content.']['preview.'] ?? []; - if (!$previewConfiguration) { - // Early return in case no preview configuration can be found + $previewConfiguration = $this->getPreviewConfiguration((int)$record->getPid()); + if ($previewConfiguration === null) { return null; } - $fluidConfiguration = $previewConfiguration['view.'] ?? []; - if (!$fluidConfiguration) { - // Early return in case no fluid template configuration can be found - return null; - } - - $templateConfiguration = $previewConfiguration['template.'] ?? []; $cType = $record->getRecordType(); - if (!empty($templateConfiguration[$cType])) { - $fluidTemplateName = $templateConfiguration[$cType]; - } else { - $fluidTemplateName = $cType; - } - $viewFactory = GeneralUtility::makeInstance(ViewFactoryInterface::class); - $view = $viewFactory->create( - new ViewFactoryData( - $fluidConfiguration['templateRootPaths.'] ?? null, - $fluidConfiguration['partialRootPaths.'] ?? null, - $fluidConfiguration['layoutRootPaths.'] ?? null, - null, - $context->getCurrentRequest() - ) - ); + $templateConfiguration = $previewConfiguration['template.'] ?? []; + $fluidTemplateName = !empty($templateConfiguration[$cType]) ? $templateConfiguration[$cType] : $cType; + $view = $this->createView($previewConfiguration['view.'], $context); $data = GeneralUtility::makeInstance(DatabaseRowService::class)->getAdditionalDataForView($record, $context); $view->assignMultiple($data); $view->assign('record', $record); @@ -66,17 +46,16 @@ public function render(RecordInterface $record, PageLayoutContext $context): ?st return null; } - public function renderLegacy(array $row): ?string + /** + * Render path for TYPO3 v13, where the page module still passes the content element as an array + * instead of a RecordInterface (see Breaking-92434). + * + * @param array $row + */ + public function renderLegacy(array $row, PageLayoutContext $context): ?string { - $previewConfiguration = BackendUtility::getPagesTSconfig($row['pid'])['mod.']['web_layout.']['tt_content.']['preview.'] ?? []; - if (!$previewConfiguration) { - // Early return in case no preview configuration can be found - return null; - } - - $fluidConfiguration = $previewConfiguration['view.'] ?? []; - if (!$fluidConfiguration) { - // Early return in case no fluid template configuration can be found + $previewConfiguration = $this->getPreviewConfiguration((int)$row['pid']); + if ($previewConfiguration === null) { return null; } @@ -89,16 +68,42 @@ public function renderLegacy(array $row): ?string $fluidTemplateName = $row['CType']; } - $view = GeneralUtility::makeInstance(StandaloneView::class); - $view->setLayoutRootPaths($fluidConfiguration['layoutRootPaths.'] ?? []); - $view->setPartialRootPaths($fluidConfiguration['partialRootPaths.'] ?? []); - $view->setTemplateRootPaths($fluidConfiguration['templateRootPaths.'] ?? []); - $view->setTemplate($fluidTemplateName); + $view = $this->createView($previewConfiguration['view.'], $context); $view->assignMultiple($row); - - if ($view->hasTemplate()) { - return $view->render(); + try { + return $view->render($fluidTemplateName); + } catch (InvalidTemplateResourceException) { } return null; } + + /** + * @return array|null + */ + protected function getPreviewConfiguration(int $pid): ?array + { + $previewConfiguration = BackendUtility::getPagesTSconfig($pid)['mod.']['web_layout.']['tt_content.']['preview.'] ?? []; + // Early return in case no preview (or fluid template) configuration can be found + if (!$previewConfiguration || empty($previewConfiguration['view.'])) { + return null; + } + return $previewConfiguration; + } + + /** + * @param array $fluidConfiguration + */ + protected function createView(array $fluidConfiguration, PageLayoutContext $context): ViewInterface + { + $viewFactory = GeneralUtility::makeInstance(ViewFactoryInterface::class); + return $viewFactory->create( + new ViewFactoryData( + $fluidConfiguration['templateRootPaths.'] ?? null, + $fluidConfiguration['partialRootPaths.'] ?? null, + $fluidConfiguration['layoutRootPaths.'] ?? null, + null, + $context->getCurrentRequest() + ) + ); + } } diff --git a/Classes/Backend/Preview/StandardContentPreviewRenderer.php b/Classes/Backend/Preview/StandardContentPreviewRenderer.php index 0d37168..09ec9d2 100644 --- a/Classes/Backend/Preview/StandardContentPreviewRenderer.php +++ b/Classes/Backend/Preview/StandardContentPreviewRenderer.php @@ -36,7 +36,7 @@ public function renderPageModulePreviewContent(GridColumnItem $item): string if ($record instanceof RecordInterface) { $content = $contentPreview->render($record, $context); } else { - $content = $contentPreview->renderLegacy($record); + $content = $contentPreview->renderLegacy($record, $context); } if ($content !== null) { return $content; diff --git a/Classes/Hooks/BackendPreviewRenderer.php b/Classes/Hooks/BackendPreviewRenderer.php deleted file mode 100644 index c13e9e2..0000000 --- a/Classes/Hooks/BackendPreviewRenderer.php +++ /dev/null @@ -1,62 +0,0 @@ -databaseRowService = $databaseRowService; - } - - /** - * Preprocesses the preview rendering of a content element of any type - * - * @param \TYPO3\CMS\Backend\View\PageLayoutView $parentObject Calling parent object - * @param bool $drawItem Whether to draw the item using the default functionality - * @param string $headerContent Header content - * @param string $itemContent Item content - * @param array $row Record row of tt_content - */ - public function preProcess( - PageLayoutView &$parentObject, - &$drawItem, - &$headerContent, - &$itemContent, - array &$row - ) { - $row = $this->databaseRowService->extendRow($row); - if ((GeneralUtility::makeInstance(Features::class))->isFeatureEnabled('fluidBasedPageModule') === false) { - $contentPreview = GeneralUtility::makeInstance(ContentPreview::class); - $content = $contentPreview->renderLegacy($row); - if ($content !== null) { - $itemContent .= $content; - $drawItem = false; - } - } - } -} diff --git a/Classes/Listener/BootCompleted.php b/Classes/Listener/BootCompleted.php deleted file mode 100644 index 4d797c9..0000000 --- a/Classes/Listener/BootCompleted.php +++ /dev/null @@ -1,45 +0,0 @@ -packageManager->isPackageActive('fontawesome_provider')) { - return; - } - $this->iconRegistry->registerIcon( - 'exclamation-triangle', - \TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider::class, - [ - 'name' => 'exclamation-triangle', - ] - ); - $this->iconRegistry->registerIcon( - 'exclamation-circle', - \TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider::class, - [ - 'name' => 'exclamation-circle', - ] - ); - } -} diff --git a/Classes/Service/DatabaseRowService.php b/Classes/Service/DatabaseRowService.php index 1e5c0bf..046a3de 100644 --- a/Classes/Service/DatabaseRowService.php +++ b/Classes/Service/DatabaseRowService.php @@ -120,38 +120,18 @@ public function extendRow(array $row): array $row['pi_flexform_transformed'] = $flexFormService->convertFlexFormContentToArray($row['pi_flexform']); } - // return all sys_file_reference rows - // automatic resolving of all type=file, only works with TYPO3 v12+ - $foundOne = false; + // return all sys_file_reference rows by automatically resolving all type=file fields foreach ($GLOBALS['TCA']['tt_content']['columns'] as $fieldName => $fieldConfig) { - if ($fieldConfig['config']['type'] === 'file') { - $variableName = GeneralUtility::underscoredToUpperCamelCase($fieldName); - if ($fieldName === 'image') { - $variableName = 'Images'; - } - if ($row[$fieldName] ?? false) { - $row['all' . $variableName] = $this->fileRepository->findByRelation('tt_content', $fieldName, $row['uid']); - $row['all' . $variableName . '-visible'] = $this->countVisibleFileReferences($row['all' . $variableName]); - } - $foundOne = true; + if (($fieldConfig['config']['type'] ?? '') !== 'file') { + continue; } - } - if (!$foundOne) { - if ($row['assets'] ?? false) { - $row['allAssets'] = $this->fileRepository->findByRelation('tt_content', 'assets', $row['uid']); - $row['allAssets-visible'] = $this->countVisibleFileReferences($row['allAssets']); - } - if ($row['assets2'] ?? false) { - $row['allAssets2'] = $this->fileRepository->findByRelation('tt_content', 'assets2', $row['uid']); - $row['allAssets2-visible'] = $this->countVisibleFileReferences($row['allAssets2']); - } - if ($row['media'] ?? false) { - $row['allMedia'] = $this->fileRepository->findByRelation('tt_content', 'media', $row['uid']); - $row['allMedia-visible'] = $this->countVisibleFileReferences($row['allMedia']); + $variableName = GeneralUtility::underscoredToUpperCamelCase($fieldName); + if ($fieldName === 'image') { + $variableName = 'Images'; } - if ($row['image'] ?? false) { - $row['allImages'] = $this->fileRepository->findByRelation('tt_content', 'image', $row['uid']); - $row['allImages-visible'] = $this->countVisibleFileReferences($row['allImages']); + if ($row[$fieldName] ?? false) { + $row['all' . $variableName] = $this->fileRepository->findByRelation('tt_content', $fieldName, $row['uid']); + $row['all' . $variableName . '-visible'] = $this->countVisibleFileReferences($row['all' . $variableName]); } } return $row; diff --git a/Classes/ViewHelpers/GetDatabaseRecordViewHelper.php b/Classes/ViewHelpers/GetDatabaseRecordViewHelper.php index ad80011..01f7d1e 100644 --- a/Classes/ViewHelpers/GetDatabaseRecordViewHelper.php +++ b/Classes/ViewHelpers/GetDatabaseRecordViewHelper.php @@ -17,7 +17,6 @@ use TYPO3\CMS\Core\Database\Query\QueryBuilder; use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; use TYPO3\CMS\Core\Database\Query\Restriction\WorkspaceRestriction; -use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; @@ -73,11 +72,7 @@ public function render(): array ->where( $queryBuilder->expr()->in('uid', $queryBuilder->createNamedParameter($uids, Connection::PARAM_INT_ARRAY)) ); - if ((new Typo3Version())->getMajorVersion() > 12) { - $queryBuilder->getConcreteQueryBuilder()->addOrderBy('FIELD(uid,' . implode(',', $uids) . ')'); - } else { - $queryBuilder->add('orderBy', 'FIELD(uid,' . implode(',', $uids) . ')'); - } + $queryBuilder->getConcreteQueryBuilder()->addOrderBy('FIELD(uid,' . implode(',', $uids) . ')'); return $queryBuilder ->executeQuery() ->fetchAllAssociative(); diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index 6d456a7..2ed931b 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -6,8 +6,6 @@ services: B13\Backendpreviews\: resource: '../Classes/*' - B13\Backendpreviews\Hooks\BackendPreviewRenderer: - public: true B13\Backendpreviews\Service\DatabaseRowService: public: true B13\Backendpreviews\Listener\PageContentPreviewRendering: @@ -15,7 +13,3 @@ services: - name: event.listener event: TYPO3\CMS\Backend\View\Event\PageContentPreviewRenderingEvent identifier: 'b13-backendpreview-page-content-preview-rendering' - B13\Backendpreviews\Listener\BootCompleted: - tags: - - name: event.listener - identifier: 'b13-backendpreview-boot-completed' diff --git a/composer.json b/composer.json index f837402..64a10ed 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "typo3/cms": { "web-dir": ".Build/Web", "extension-key": "backendpreviews", - "version": "1.5.2", + "version": "2.0.0", "Package": { "providesPackages": {} } @@ -16,8 +16,8 @@ "GPL-2.0-or-later" ], "require": { - "php": "^7.4 || ~8.0", - "typo3/cms-backend": "^10.4 || ^11.5 || ^12.4 || ^13.4 || ^14.3" + "php": "^8.2", + "typo3/cms-backend": "^13.4 || ^14.3" }, "require-dev": { "phpstan/phpstan": "^1.10", diff --git a/ext_emconf.php b/ext_emconf.php index a7c34c1..15ac31a 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -9,10 +9,10 @@ 'state' => 'stable', 'clearCacheOnLoad' => true, 'author_company' => 'b13 GmbH, Stuttgart', - 'version' => '1.5.2', + 'version' => '2.0.0', 'constraints' => [ 'depends' => [ - 'typo3' => '10.4.0-14.99.99', + 'typo3' => '13.4.0-14.99.99', ], ], ]; diff --git a/ext_localconf.php b/ext_localconf.php index e25159a..8aa9adc 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -2,32 +2,4 @@ defined('TYPO3') or die(); -if ((\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Information\Typo3Version::class))->getMajorVersion() < 12) { - // extends database row and render Backend-Preview if fluidBasedPageModule is not used - // (if fluidBasedPageModule is used "$GLOBALS['TCA']['tt_content']['ctrl']['previewRenderer']" takes effect for Backend-Preview-Rendering) - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['tx_backendpreviews'] = - \B13\Backendpreviews\Hooks\BackendPreviewRenderer::class; -} -// if TYPO3 > 11 "$GLOBALS['TCA']['tt_content']['ctrl']['previewRenderer']" is always used for Backend-Preview-Rendering -// extending the database row is handled by B13\Backendpreviews\Listener\PageContentPreviewRendering - -if ((new \TYPO3\CMS\Core\Information\Typo3Version())->getMajorVersion() < 12) { - $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); - $iconRegistry->registerIcon( - 'exclamation-triangle', - \TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider::class, - [ - 'name' => 'exclamation-triangle', - ] - ); - $iconRegistry->registerIcon( - 'exclamation-circle', - \TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider::class, - [ - 'name' => 'exclamation-circle', - ] - ); -} -if ((\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Information\Typo3Version::class))->getMajorVersion() >= 12) { - $GLOBALS['TYPO3_CONF_VARS']['BE']['stylesheets']['b13/backendpreviews'] = 'EXT:backendpreviews/Resources/Public/Backend/Css/Skin/'; -} +$GLOBALS['TYPO3_CONF_VARS']['BE']['stylesheets']['b13/backendpreviews'] = 'EXT:backendpreviews/Resources/Public/Backend/Css/Skin/'; diff --git a/ext_tables.php b/ext_tables.php deleted file mode 100644 index 0983654..0000000 --- a/ext_tables.php +++ /dev/null @@ -1,12 +0,0 @@ -getMajorVersion() < 12) { - $GLOBALS['TBE_STYLES']['skins']['backendpreviews']['name'] = 'backendpreviews'; - $GLOBALS['TBE_STYLES']['skins']['backendpreviews']['stylesheetDirectories'] = [ - 'EXT:backendpreviews/Resources/Public/Backend/Css/Skin/', - ]; - } -})();