Skip to content

Commit 7ff2844

Browse files
AquaTixzzZachimfritz
authored andcommitted
[BUGFIX] hide container in elementWizard if 'setRegisterInNewContentElementWizard' is set to false.
1 parent 92ea964 commit 7ff2844

File tree

6 files changed

+21
-8
lines changed

6 files changed

+21
-8
lines changed

Build/phpstan-baseline-11-7.4.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ parameters:
33

44
-
55
message: "#^Constant LF not found\\.$#"
6-
count: 4
6+
count: 5
77
path: ../Classes/Tca/Registry.php
88

99
-

Build/phpstan-baseline-11.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ parameters:
33

44
-
55
message: "#^Constant LF not found\\.$#"
6-
count: 4
6+
count: 5
77
path: ../Classes/Tca/Registry.php
88

99
-

Build/phpstan-baseline-12.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ parameters:
33

44
-
55
message: "#^Constant LF not found\\.$#"
6-
count: 4
6+
count: 5
77
path: ../Classes/Tca/Registry.php
88

99
-

Build/phpstan-baseline-13.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ parameters:
33

44
-
55
message: "#^Constant LF not found\\.$#"
6-
count: 4
6+
count: 5
77
path: ../Classes/Tca/Registry.php
88

99
-

Build/phpstan-baseline-14.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ parameters:
33

44
-
55
message: "#^Constant LF not found\\.$#"
6-
count: 4
6+
count: 5
77
path: ../Classes/Tca/Registry.php
88

99
-

Classes/Tca/Registry.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,10 @@ public function getPageTsString(): string
257257
// group containers by group
258258
$groupedByGroup = [];
259259
$defaultGroup = 'container';
260+
261+
$typo3Version = GeneralUtility::makeInstance(Typo3Version::class);
262+
$cTypesExcludedInNewContentElementWizard = [];
263+
260264
foreach ($GLOBALS['TCA']['tt_content']['containerConfiguration'] as $cType => $containerConfiguration) {
261265
if ($containerConfiguration['registerInNewContentElementWizard'] === true) {
262266
$group = $containerConfiguration['group'] !== '' ? $containerConfiguration['group'] : $defaultGroup;
@@ -269,10 +273,19 @@ public function getPageTsString(): string
269273
' . $cType . ' = ' . $containerConfiguration['backendTemplate'] . '
270274
}
271275
';
272-
}
273-
$typo3Version = GeneralUtility::makeInstance(Typo3Version::class);
274-
if ($typo3Version->getMajorVersion() > 12) {
275276
// s. https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.0/Breaking-102834-RemoveItemsFromNewContentElementWizard.html
277+
if ($typo3Version->getMajorVersion() > 12) {
278+
if ($containerConfiguration['registerInNewContentElementWizard'] === false) {
279+
$group = $containerConfiguration['group'] !== '' ? $containerConfiguration['group'] : $defaultGroup;
280+
$cTypesExcludedInNewContentElementWizard[$group][] = $cType;
281+
}
282+
}
283+
}
284+
285+
if ($typo3Version->getMajorVersion() > 12 && !empty($cTypesExcludedInNewContentElementWizard)) {
286+
foreach ($cTypesExcludedInNewContentElementWizard as $group => $ctypes) {
287+
$pageTs .= LF . 'mod.wizards.newContentElement.wizardItems.' . $group . '.removeItems := addToList(' . implode(',', $ctypes) . ')';
288+
}
276289
return $pageTs;
277290
}
278291

0 commit comments

Comments
 (0)