Skip to content
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
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,16 @@ jobs:
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s unit

- name: Functional Tests
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s functional -- --do-not-fail-on-deprecation
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s functional -- --do-not-fail-on-deprecation --exclude-group v14-only
if: matrix.TYPO3 == '13'

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

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

- name: Acceptance Tests
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s acceptance -- --fail-fast
Expand Down
1 change: 1 addition & 0 deletions Build/phpstan13.neon
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ parameters:
- %currentWorkingDirectory%/Classes/Listener/PageContentPreviewRendering.php
- %currentWorkingDirectory%/Classes/Listener/ManipulateBackendLayoutColPosConfigurationForPage.php
- %currentWorkingDirectory%/Classes/Hooks/Datahandler/ContentElementRestriction
- %currentWorkingDirectory%/Classes/Listener/IsReferenceConsideredForDependency.php

2 changes: 2 additions & 0 deletions Build/phpstan14.neon
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ parameters:
- %currentWorkingDirectory%/Classes/Listener/LegacyPageContentPreviewRendering.php
- %currentWorkingDirectory%/Classes/ContentDefender
- %currentWorkingDirectory%/Tests/Functional/Integrity/IntegrityTest.php
# can be removed when 14.2 is released
- %currentWorkingDirectory%/Classes/Listener/IsReferenceConsideredForDependency.php

33 changes: 33 additions & 0 deletions Classes/Listener/IsReferenceConsideredForDependency.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

declare(strict_types=1);

namespace B13\Container\Listener;

/*
* This file is part of TYPO3 CMS-based extension "container" by b13.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*/

use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Workspaces\Dependency\DependencyCollectionAction;
use TYPO3\CMS\Workspaces\Event\IsReferenceConsideredForDependencyEvent;

#[AsEventListener(identifier: 'tx-container-is-reference-considered-for-dependency')]
class IsReferenceConsideredForDependency
{
public function __invoke(IsReferenceConsideredForDependencyEvent $event)
{
if (
$event->getTableName() === 'tt_content' &&
$event->getFieldName() === 'tx_container_parent' &&
$event->getReferenceTable() === 'tt_content' &&
$event->getAction() === DependencyCollectionAction::Publish
) {
$event->setDependency(true);
}
}
}
21 changes: 21 additions & 0 deletions Tests/Functional/Datahandler/Workspace/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/

use B13\Container\Tests\Functional\Datahandler\AbstractDatahandler;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\Test;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Context\WorkspaceAspect;
Expand All @@ -31,6 +32,26 @@ protected function setUp(): void
$context->setAspect('workspace', $workspaceAspect);
}

#[Test]
#[Group('v14-only')]
public function publishChildPublishAlsoParentContainer(): void
{
$this->importCSVDataSet(__DIR__ . '/Fixtures/PublishChildPublishAlsoParentContainer.csv');
$cmdmap = [
'tt_content' => [
2 => [
'version' => [
'action' => 'publish',
'swapWith' => 2,
],
],
],
];
$this->dataHandler->start([], $cmdmap, $this->backendUser);
$this->dataHandler->process_cmdmap();
self::assertCSVDataSet(__DIR__ . '/Fixtures/PublishChildPublishAlsoParentContainerResult.csv');
}

#[Test]
public function deleteContainerDeleteChildren(): void
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"tt_content"
,"uid","pid","CType","header","t3ver_wsid","t3ver_state","colPos","tx_container_parent"
,"1","1","b13-2cols-with-header-container","container-element","1","1","0","0"
,"2","1","header","container-child-element","1","1","200","1"
"sys_refindex"
,"hash","workspace","tablename","field","ref_table","ref_uid","recuid"
,"73cc8f1fe4a83716bd7bf9e2153dbc42","1","tt_content","tx_container_parent","tt_content","1","2"

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"tt_content"
,"uid","pid","CType","header","t3ver_wsid","colPos","tx_container_parent"
,"1","1","b13-2cols-with-header-container","container-element","0","0","0"
,"2","1","header","container-child-element","0","200","1"
"sys_refindex"
,"hash","workspace","tablename","field","ref_table","ref_uid","recuid"
,"06066e3d1b5e88d04eb6a99178133874","0","tt_content","tx_container_parent","tt_content","1","2"

Loading