Skip to content
Open
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
1 change: 1 addition & 0 deletions Build/Scripts/setupAcceptanceComposer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ vendor/bin/typo3 dataset:import "${FIXTURES}/pageWithWorkspace.csv"
vendor/bin/typo3 dataset:import "${FIXTURES}/pageWithWorkspace-movedContainer.csv"
vendor/bin/typo3 dataset:import "${FIXTURES}/pageWithWorkspace-changedContainer.csv"
vendor/bin/typo3 dataset:import "${FIXTURES}/pageWithContainerAndContentElementOutside.csv"
vendor/bin/typo3 dataset:import "${FIXTURES}/pageWithNestedContainer.csv"
echo "finished"
2 changes: 1 addition & 1 deletion Build/acceptance_tests/composer.13.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"ichhabrecht/content-defender": "*",
"typo3tests/dataset-import": "@dev",
"typo3/testing-framework": "^9.1",
"b13/container-example": "dev-master"
"b13/container-example": "dev-task/conf"
},
"config": {
"allow-plugins": {
Expand Down
2 changes: 1 addition & 1 deletion Build/acceptance_tests/composer.14.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"b13/container": "@dev",
"typo3tests/dataset-import": "@dev",
"typo3/testing-framework": "^9.1",
"b13/container-example": "dev-master"
"b13/container-example": "dev-task/conf"
},
"config": {
"allow-plugins": {
Expand Down
3 changes: 2 additions & 1 deletion Build/acceptance_tests/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,5 @@ vendor/bin/typo3 dataset:import "${FIXTURES}/pageWithWorkspace.csv"
vendor/bin/typo3 dataset:import "${FIXTURES}/pageWithWorkspace-movedContainer.csv"
vendor/bin/typo3 dataset:import "${FIXTURES}/pageWithWorkspace-changedContainer.csv"
vendor/bin/typo3 dataset:import "${FIXTURES}/pageWithContainerAndContentElementOutside.csv"
echo "finished"
vendor/bin/typo3 dataset:import "${FIXTURES}/pageWithNestedContainer.csv"
echo "finished"
2 changes: 1 addition & 1 deletion Classes/Tca/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function recordIsAllowedInContainerColumn(RecordInterface $record): bool

public function isAllowedInColumn(string $cType, int $colPos, string $containerCType): bool
{
$contentDefenderConfiguration = $this->getContentDefenderConfiguration($cType, $colPos);
$contentDefenderConfiguration = $this->getContentDefenderConfiguration($containerCType, $colPos);
$disallowed = GeneralUtility::trimExplode(',', $contentDefenderConfiguration['disallowedContentTypes'] ?? '', true);
if (in_array($cType, $disallowed)) {
return false;
Expand Down
22 changes: 22 additions & 0 deletions Tests/Acceptance/Backend/ContentDefenderCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,26 @@ public function seeEditDocumentWhenAddingChildrenToColposWhereOnlyHeaderIsAllowe
$I->see('header', 'select');
$I->dontSee('Images Only', 'select');
}

#[Group('content_defender')]
public function nestedContainerOfDisallowedContentTypeIsMarkedAsNotAllowed(BackendTester $I, PageTree $pageTree): void
{
$I->clickLayoutModuleButton();
$pageTree->openPath(['home', 'pageWithNestedContainer']);
$I->wait(0.5);
$I->switchToContentFrame();
$I->waitForElement('#element-tt_content-1003');
$I->seeElement('#element-tt_content-1003.t3-page-ce-warning');
}

#[Group('content_defender')]
public function nestedContainerOfDifferentTypeIsNotMarkedAsNotAllowed(BackendTester $I, PageTree $pageTree): void
{
$I->clickLayoutModuleButton();
$pageTree->openPath(['home', 'pageWithNestedContainer']);
$I->wait(0.5);
$I->switchToContentFrame();
$I->waitForElement('#element-tt_content-1001');
$I->dontSeeElement('#element-tt_content-1001.t3-page-ce-warning');
}
}
9 changes: 9 additions & 0 deletions Tests/Acceptance/Fixtures/pageWithNestedContainer.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"pages"
,"uid","pid","is_siteroot","title","perms_everybody","sys_language_uid","l10n_parent","l10n_source"
,51,1,,"pageWithNestedContainer",17,,,
"tt_content"
,"uid","pid","CType","header","colPos","tx_container_parent","l18n_parent","sys_language_uid","t3ver_wsid","t3ver_oid","l10n_source","t3ver_state"
,1000,51,"b13-2cols",,,,,,,,,
,1001,51,"b13-1col",,200,1000,,,,,,,
,1002,51,"b13-1col",,,,,,,,,,
,1003,51,"b13-1col",,200,1002,,,,,,,
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class BackendContainerEnvironment extends BackendEnvironment
__DIR__ . '/../../Fixtures/pageWithWorkspace-movedContainer.csv',
__DIR__ . '/../../Fixtures/pageWithContainerAndContentElementOutside.csv',
__DIR__ . '/../../Fixtures/pageWithWorkspace-changedContainer.csv',
__DIR__ . '/../../Fixtures/pageWithNestedContainer.csv',
__DIR__ . '/../../Fixtures/pages.csv',
__DIR__ . '/../../Fixtures/sys_workspace.csv',
__DIR__ . '/../../Fixtures/be_groups.csv',
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
},
"require-dev": {
"b13/container-example": "dev-master",
"b13/container-example": "dev-task/conf",
"typo3/cms-install": "^13.4 || ^14.3",
"typo3/cms-fluid-styled-content": "^13.4 || ^14.3",
"typo3/cms-info": "^13.4 || ^14.3",
Expand Down