Skip to content

Commit 6c0265a

Browse files
committed
[BUGFIX] can copy into container
Fixes: #588
1 parent f2bf979 commit 6c0265a

4 files changed

Lines changed: 79 additions & 1 deletion

File tree

Classes/ContentDefender/Xclasses/DatamapHook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public function processDatamap_beforeStart(DataHandler $dataHandler): void
7979
}
8080
}
8181
}
82+
parent::processDatamap_beforeStart($dataHandler);
8283
}
83-
parent::processDatamap_beforeStart($dataHandler);
8484
}
8585

8686
protected function isRecordAllowedByRestriction(array $columnConfiguration, array $record): bool

Tests/Functional/Datahandler/ContentDefender/DefaultLanguageTest.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,37 @@ public function moveElementIntoContainerAfterOtherElemenMoveAllowedCTypeElement(
174174
self::assertCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/MoveElementIntoContainerAfterOtherElemenMoveAllowedCTypeElementResult.csv');
175175
}
176176

177+
/**
178+
* @test
179+
* @group content_defender
180+
*/
181+
public function copyContentElementIntoContainerWhenCTypeIsNotAllowedInBackendLayoutColumn(): void
182+
{
183+
$this->importCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/CopyContentElementIntoContainerWhenCTypeIsNotAllowedInBackendLayoutColumn.csv');
184+
// 12 -> 11 colpos 200
185+
$cmdmap = [
186+
'tt_content' => [
187+
12 => [
188+
'copy' => [
189+
'action' => 'paste',
190+
'target' => 1,
191+
'update' => [
192+
'colPos' => 200,
193+
'sys_language_uid' => 0,
194+
'tx_container_parent' => 11,
195+
196+
],
197+
],
198+
],
199+
],
200+
];
201+
202+
$this->dataHandler->start([], $cmdmap, $this->backendUser);
203+
$this->dataHandler->process_datamap();
204+
$this->dataHandler->process_cmdmap();
205+
self::assertCSVDataSet(__DIR__ . '/Fixtures/DefaultLanguage/CopyContentElementIntoContainerWhenCTypeIsNotAllowedInBackendLayoutColumnResult.csv');
206+
}
207+
177208
/**
178209
* @test
179210
* @group content_defender
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"pages"
2+
,"uid","pid","backend_layout","TSconfig"
3+
,2,1,"pagets__exampleKey","<![CDATA[
4+
mod.web_layout.BackendLayouts {
5+
exampleKey {
6+
title = Example
7+
config {
8+
backend_layout {
9+
colCount = 1
10+
rowCount = 2
11+
rows {
12+
1 {
13+
columns {
14+
1 {
15+
name = 0x1
16+
colPos = 9
17+
allowed {
18+
CType = b13-2cols-with-header-container,bullets
19+
}
20+
}
21+
}
22+
}
23+
2 {
24+
columns {
25+
1 {
26+
name = 0x0
27+
colPos = 10
28+
}
29+
}
30+
}
31+
}
32+
}
33+
}
34+
}
35+
}
36+
]]>"
37+
"tt_content"
38+
,"uid","pid","colPos","CType","tx_container_parent"
39+
,11,2,9,"b13-2cols-with-header-container",0
40+
,12,2,10,"header",0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"tt_content"
2+
,"uid","pid","colPos","CType","tx_container_parent"
3+
,1,1,0,"b13-2cols-with-header-container",0
4+
,2,1,200,"header",1
5+
,11,2,9,"b13-2cols-with-header-container",0
6+
,12,2,10,"header",0
7+
,13,2,200,"header",11

0 commit comments

Comments
 (0)