Skip to content

[TASK] allow TYPO3 14.0.x-dev branch installation #605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jobs:
php: '8.2'
- TYPO3: '13'
php: '8.3'
- TYPO3: '14'
php: '8.2'
- TYPO3: '14'
php: '8.3'
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -50,9 +54,11 @@ jobs:

- name: Functional Tests
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s functional
if: matrix.TYPO3 != '14'

- name: Acceptance Tests
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s acceptance -- --fail-fast
if: matrix.TYPO3 != '14'

- name: Archive acceptance tests results
uses: actions/upload-artifact@v4
Expand Down
15 changes: 11 additions & 4 deletions Build/Scripts/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,12 @@ Options:
- 8.3: use PHP 8.3
- 8.4: use PHP 8.4

-t <11|12|13>
-t <11|12|13|14>
Specifies the TYPO3 Core version to be used - Only with -s composerInstall|phpstan|acceptance
- 11: Use TYPO3 v11.5
- 12 (default): Use TYPO3 v12.4
- 13: Use TYPO3 v13.x
- 14: Use TYPO3 14.0.x-dev

-a <mysqli|pdo_mysql>
Only with -s functional|functionalDeprecated
Expand Down Expand Up @@ -337,7 +338,7 @@ while getopts "a:b:s:d:i:t:p:xy:o:nhug" OPT; do
;;
t)
TYPO3=${OPTARG}
if ! [[ ${TYPO3} =~ ^(11|12|13)$ ]]; then
if ! [[ ${TYPO3} =~ ^(11|12|13|14)$ ]]; then
INVALID_OPTIONS+=("${OPTARG}")
fi
# @todo Remove USE_APACHE option when TF7 has been dropped (along with TYPO3 v11 support).
Expand Down Expand Up @@ -598,10 +599,13 @@ case ${TEST_SUITE} in
composer require typo3/cms-core:^11.5 ichhabrecht/content-defender --dev -W --no-progress --no-interaction
composer prepare-tests
elif [ ${TYPO3} -eq 13 ]; then
composer require typo3/cms-core:^13.4 ichhabrecht/content-defender --dev -W --no-progress --no-interaction
composer require typo3/cms-core:^13.4 typo3/testing-framework:^8.2 phpunit/phpunit:^10.5 ichhabrecht/content-defender --dev -W --no-progress --no-interaction
composer prepare-tests
elif [ ${TYPO3} -eq 14 ]; then
composer require typo3/cms-core:14.0.x-dev --dev -W --no-progress --no-interaction
composer prepare-tests
else
composer require typo3/cms-core:^12.4 ichhabrecht/content-defender --dev -W --no-progress --no-interaction
composer require typo3/cms-core:^12.4 typo3/testing-framework:^8.2 phpunit/phpunit:^10.5 ichhabrecht/content-defender --dev -W --no-progress --no-interaction
composer prepare-tests
fi
"
Expand All @@ -619,6 +623,9 @@ case ${TEST_SUITE} in
if [ ${TYPO3} -eq 11 ]; then
composer require typo3/cms-core:^11.5 ichhabrecht/content-defender --dev -W --no-progress --no-interaction
composer prepare-tests
elif [ ${TYPO3} -eq 14 ]; then
composer require typo3/cms-core:14.0.x-dev --dev -W --no-progress --no-interaction
composer prepare-tests
elif [ ${TYPO3} -eq 13 ]; then
composer require typo3/cms-core:^13.4 ichhabrecht/content-defender --dev -W --no-progress --no-interaction
composer prepare-tests
Expand Down
19 changes: 19 additions & 0 deletions Build/phpstan-baseline-11-7.4.neon
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,22 @@ parameters:
message: "#^Class TYPO3\\\\CMS\\\\Backend\\\\View\\\\PageLayoutContext constructor invoked with 5 parameters, 2 required\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php
-
message: "#^Class TYPO3\\\\CMS\\\\Core\\\\View\\\\ViewFactoryInterface not found\\.$#"
count: 1
path: ../Classes/Backend/Preview/GridRenderer.php

-
message: "#^Instantiated class TYPO3\\\\CMS\\\\Core\\\\View\\\\ViewFactoryData not found\\.$#"
count: 1
path: ../Classes/Backend/Preview/GridRenderer.php

-
message: "#^Call to an undefined static method TYPO3\\\\CMS\\\\Core\\\\Versioning\\\\VersionState\\:\\:tryFrom\\(\\)\\.$#"
count: 1
path: ../Classes/Domain/Factory/ContainerFactory.php

-
message: "#^Call to an undefined static method TYPO3\\\\CMS\\\\Core\\\\Versioning\\\\VersionState\\:\\:tryFrom\\(\\)\\.$#"
count: 2
path: ../Classes/Domain/Factory/PageView/Backend/ContentStorage.php
20 changes: 20 additions & 0 deletions Build/phpstan-baseline-11.neon
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,23 @@ parameters:
message: "#^Attribute class TYPO3\\\\CMS\\\\Install\\\\Attribute\\\\UpgradeWizard does not exist\\.$#"
count: 1
path: ../Classes/Updates/ContainerMigrateSorting.php

-
message: "#^Class TYPO3\\\\CMS\\\\Core\\\\View\\\\ViewFactoryInterface not found\\.$#"
count: 1
path: ../Classes/Backend/Preview/GridRenderer.php

-
message: "#^Instantiated class TYPO3\\\\CMS\\\\Core\\\\View\\\\ViewFactoryData not found\\.$#"
count: 1
path: ../Classes/Backend/Preview/GridRenderer.php

-
message: "#^Call to an undefined static method TYPO3\\\\CMS\\\\Core\\\\Versioning\\\\VersionState\\:\\:tryFrom\\(\\)\\.$#"
count: 1
path: ../Classes/Domain/Factory/ContainerFactory.php

-
message: "#^Call to an undefined static method TYPO3\\\\CMS\\\\Core\\\\Versioning\\\\VersionState\\:\\:tryFrom\\(\\)\\.$#"
count: 2
path: ../Classes/Domain/Factory/PageView/Backend/ContentStorage.php
26 changes: 25 additions & 1 deletion Build/phpstan-baseline-12.neon
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,28 @@ parameters:
-
message: "#^Class TYPO3\\\\CMS\\\\Backend\\\\View\\\\PageLayoutContext constructor invoked with 5 parameters, 2 required\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php
path: ../Tests/Functional/Integrity/IntegrityTest.php
-
message: "#^Call to method create\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\View\\\\ViewFactoryInterface\\.$#"
count: 1
path: ../Classes/Backend/Preview/GridRenderer.php

-
message: "#^Class TYPO3\\\\CMS\\\\Core\\\\View\\\\ViewFactoryInterface not found\\.$#"
count: 1
path: ../Classes/Backend/Preview/GridRenderer.php

-
message: "#^Instantiated class TYPO3\\\\CMS\\\\Core\\\\View\\\\ViewFactoryData not found\\.$#"
count: 1
path: ../Classes/Backend/Preview/GridRenderer.php

-
message: "#^Call to an undefined static method TYPO3\\\\CMS\\\\Core\\\\Versioning\\\\VersionState\\:\\:tryFrom\\(\\)\\.$#"
count: 1
path: ../Classes/Domain/Factory/ContainerFactory.php

-
message: "#^Call to an undefined static method TYPO3\\\\CMS\\\\Core\\\\Versioning\\\\VersionState\\:\\:tryFrom\\(\\)\\.$#"
count: 2
path: ../Classes/Domain/Factory/PageView/Backend/ContentStorage.php
81 changes: 81 additions & 0 deletions Build/phpstan-baseline-14.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
parameters:
ignoreErrors:

-
message: "#^Constant LF not found\\.$#"
count: 4
path: ../Classes/Tca/Registry.php

-
message: "#^PHPDoc tag @return has invalid value \\(\\)\\: Unexpected token \"\\\\n \\* \", expected type at offset 679$#"
count: 1
path: ../Tests/Acceptance/Support/BackendTester.php

-
message: "#^PHPDoc tag @return has invalid value \\(\\)\\: Unexpected token \"\\\\n \\* \", expected type at offset 743$#"
count: 1
path: ../Tests/Acceptance/Support/BackendTester.php

-
message: "#^PHPDoc tag @throws with type B13\\\\Container\\\\Tests\\\\Acceptance\\\\Support\\\\_generated\\\\ConfigurationException is not subtype of Throwable$#"
count: 1
path: ../Tests/Acceptance/Support/BackendTester.php

-
message: "#^PHPDoc tag @throws with type B13\\\\Container\\\\Tests\\\\Acceptance\\\\Support\\\\_generated\\\\ModuleException is not subtype of Throwable$#"
count: 1
path: ../Tests/Acceptance/Support/BackendTester.php

-
message: "#^Property TYPO3\\\\TestingFramework\\\\Core\\\\Acceptance\\\\Helper\\\\AbstractPageTree\\:\\:\\$tester \\(AcceptanceTester\\) does not accept B13\\\\Container\\\\Tests\\\\Acceptance\\\\Support\\\\BackendTester\\.$#"
count: 1
path: ../Tests/Acceptance/Support/PageTree.php

-
message: "#^Constant ORIGINAL_ROOT not found\\.$#"
count: 1
path: ../Tests/Functional/Datahandler/AbstractDatahandler.php

-
message: "#^Class TYPO3\\\\CMS\\\\Backend\\\\View\\\\PageLayoutContext constructor invoked with 2 parameters, 5 required\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php
-
message: "#^Call to method assign\\(\\) on an unknown class TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView\\.$#"
count: 8
path: ../Classes/Backend/Preview/GridRenderer.php

-
message: "#^Call to method render\\(\\) on an unknown class TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView\\.$#"
count: 1
path: ../Classes/Backend/Preview/GridRenderer.php

-
message: "#^Call to method setLayoutRootPaths\\(\\) on an unknown class TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView\\.$#"
count: 1
path: ../Classes/Backend/Preview/GridRenderer.php

-
message: "#^Call to method setPartialRootPaths\\(\\) on an unknown class TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView\\.$#"
count: 1
path: ../Classes/Backend/Preview/GridRenderer.php

-
message: "#^Call to method setTemplatePathAndFilename\\(\\) on an unknown class TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView\\.$#"
count: 1
path: ../Classes/Backend/Preview/GridRenderer.php

-
message: "#^Class TYPO3\\\\CMS\\\\Fluid\\\\View\\\\StandaloneView not found\\.$#"
count: 1
path: ../Classes/Backend/Preview/GridRenderer.php

-
message: "#^Call to an undefined static method TYPO3\\\\CMS\\\\Core\\\\Versioning\\\\VersionState\\:\\:cast\\(\\)\\.$#"
count: 1
path: ../Classes/Domain/Factory/ContainerFactory.php

-
message: "#^Call to an undefined static method TYPO3\\\\CMS\\\\Core\\\\Versioning\\\\VersionState\\:\\:cast\\(\\)\\.$#"
count: 2
path: ../Classes/Domain/Factory/PageView/Backend/ContentStorage.php
20 changes: 20 additions & 0 deletions Build/phpstan14.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
includes:
- phpstan-baseline-14.neon

parameters:
level: 5

paths:
- %currentWorkingDirectory%/Classes
- %currentWorkingDirectory%/Tests

excludePaths:
- %currentWorkingDirectory%/Classes/Hooks/UsedRecords.php
- %currentWorkingDirectory%/Tests/Functional/Hooks/UsedRecordsTest.php
- %currentWorkingDirectory%/Tests/Unit/Hooks/UsedRecordsTest.php
- %currentWorkingDirectory%/Classes/Hooks/WizardItems.php
- %currentWorkingDirectory%/Classes/Listener/LegacyPageTsConfig.php
- %currentWorkingDirectory%/Classes/ContentDefender
- %currentWorkingDirectory%/Classes/Events/BeforeContainerPreviewIsRenderedEvent.php
- %currentWorkingDirectory%/Tests/Functional/Integrity/IntegrityTest.php

31 changes: 24 additions & 7 deletions Classes/Backend/Preview/GridRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,20 @@
use B13\Container\Domain\Factory\Exception;
use B13\Container\Domain\Factory\PageView\Backend\ContainerFactory;
use B13\Container\Events\BeforeContainerPreviewIsRenderedEvent;
use B13\Container\Events\BeforeContainerPreviewIsRenderedEventV12;
use B13\Container\Tca\Registry;
use Psr\EventDispatcher\EventDispatcherInterface;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\View\BackendLayout\Grid\Grid;
use TYPO3\CMS\Backend\View\BackendLayout\Grid\GridColumnItem;
use TYPO3\CMS\Backend\View\BackendLayout\Grid\GridRow;
use TYPO3\CMS\Backend\View\PageLayoutContext;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\View\ViewFactoryData;
use TYPO3\CMS\Core\View\ViewFactoryInterface;
use TYPO3\CMS\Fluid\View\StandaloneView;

class GridRenderer
Expand Down Expand Up @@ -86,10 +89,20 @@ public function renderGrid(array $record, PageLayoutContext $context): string
$gridTemplate = $this->tcaRegistry->getGridTemplate($record['CType']);
$partialRootPaths = $this->tcaRegistry->getGridPartialPaths($record['CType']);
$layoutRootPaths = $this->tcaRegistry->getGridLayoutPaths($record['CType']);
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setPartialRootPaths($partialRootPaths);
$view->setLayoutRootPaths($layoutRootPaths);
$view->setTemplatePathAndFilename($gridTemplate);
if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() <= 13) {
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setPartialRootPaths($partialRootPaths);
$view->setLayoutRootPaths($layoutRootPaths);
$view->setTemplatePathAndFilename($gridTemplate);
} else {
$viewFactory = GeneralUtility::makeInstance(ViewFactoryInterface::class);
$view = $viewFactory->create(new ViewFactoryData(
null,
$partialRootPaths,
$layoutRootPaths,
$gridTemplate
));
}

$view->assign('hideRestrictedColumns', (bool)(BackendUtility::getPagesTSconfig($context->getPageId())['mod.']['web_layout.']['hideRestrictedCols'] ?? false));
$view->assign('newContentTitle', $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newContentElement'));
Expand All @@ -101,8 +114,12 @@ public function renderGrid(array $record, PageLayoutContext $context): string
$view->assign('containerRecord', $record);
$view->assign('context', $context);
$parentGridColumnItem = $this->runtimeCache->get('tx_container_current_gridColumItem');
$beforeContainerPreviewIsRendered = new BeforeContainerPreviewIsRenderedEvent($container, $view, $grid, $parentGridColumnItem);
$this->eventDispatcher->dispatch($beforeContainerPreviewIsRendered);
if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() <= 13) {
// cannot be used for v14 / dev-main branch
// needs adaption in next major version
$beforeContainerPreviewIsRendered = new BeforeContainerPreviewIsRenderedEvent($container, $view, $grid, $parentGridColumnItem);
$this->eventDispatcher->dispatch($beforeContainerPreviewIsRendered);
}
$rendered = $view->render();
return $rendered;
}
Expand Down
11 changes: 9 additions & 2 deletions Classes/Domain/Factory/ContainerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use B13\Container\Tca\Registry;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Versioning\VersionState;
Expand Down Expand Up @@ -107,8 +108,14 @@ protected function workspaceOverlay(array $records): array
$filtered = [];
foreach ($records as $row) {
BackendUtility::workspaceOL('tt_content', $row, $this->workspaceId, true);
if ($row && !VersionState::cast($row['t3ver_state'] ?? 0)->equals(VersionState::DELETE_PLACEHOLDER)) {
$filtered[] = $row;
if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() > 12) {
if ($row && VersionState::tryFrom($row['t3ver_state'] ?? 0) !== VersionState::DELETE_PLACEHOLDER) {
$filtered[] = $row;
}
} else {
if ($row && !VersionState::cast($row['t3ver_state'] ?? 0)->equals(VersionState::DELETE_PLACEHOLDER)) {
$filtered[] = $row;
}
}
}
return $filtered;
Expand Down
22 changes: 18 additions & 4 deletions Classes/Domain/Factory/PageView/Backend/ContentStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use B13\Container\Domain\Factory\Database;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Versioning\VersionState;

class ContentStorage
Expand Down Expand Up @@ -85,8 +87,14 @@ public function workspaceOverlay(array $records): array
$filtered = [];
foreach ($records as $row) {
BackendUtility::workspaceOL('tt_content', $row, $this->workspaceId, true);
if ($row && !VersionState::cast($row['t3ver_state'] ?? 0)->equals(VersionState::DELETE_PLACEHOLDER)) {
$filtered[] = $row;
if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() > 12) {
if ($row && VersionState::tryFrom($row['t3ver_state'] ?? 0) !== VersionState::DELETE_PLACEHOLDER) {
$filtered[] = $row;
}
} else {
if ($row && !VersionState::cast($row['t3ver_state'] ?? 0)->equals(VersionState::DELETE_PLACEHOLDER)) {
$filtered[] = $row;
}
}
}
return $filtered;
Expand All @@ -95,8 +103,14 @@ public function workspaceOverlay(array $records): array
public function containerRecordWorkspaceOverlay(array $record): ?array
{
BackendUtility::workspaceOL('tt_content', $record, $this->workspaceId, false);
if ($record && !VersionState::cast($record['t3ver_state'] ?? 0)->equals(VersionState::DELETE_PLACEHOLDER)) {
return $record;
if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() > 12) {
if ($record && VersionState::tryFrom($record['t3ver_state'] ?? 0) !== VersionState::DELETE_PLACEHOLDER) {
return $record;
}
} else {
if ($record && !VersionState::cast($record['t3ver_state'] ?? 0)->equals(VersionState::DELETE_PLACEHOLDER)) {
return $record;
}
}
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Domain/Service/ContainerServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ContainerServiceTest extends UnitTestCase
/**
* @return array
*/
public function setupDataProvider()
public static function setupDataProvider()
{
return [
[
Expand Down
Loading
Loading