File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -259,8 +259,8 @@ public function getPageTsString(): string
259259 $ groupedByGroup = [];
260260 $ defaultGroup = 'container ' ;
261261
262- $ content = '' ;
263262 $ typo3Version = GeneralUtility::makeInstance (Typo3Version::class);
263+ $ cTypesByGroup = [];
264264
265265 foreach ($ GLOBALS ['TCA ' ]['tt_content ' ]['containerConfiguration ' ] as $ cType => $ containerConfiguration ) {
266266 if ($ containerConfiguration ['registerInNewContentElementWizard ' ] === true ) {
@@ -275,10 +275,19 @@ public function getPageTsString(): string
275275}
276276 ' ;
277277 // s. https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.0/Breaking-102834-RemoveItemsFromNewContentElementWizard.html
278- if ($ typo3Version ->getMajorVersion () >= 13 && $ containerConfiguration ['registerInNewContentElementWizard ' ] === false ) {
279- $ content .= "mod.wizards.newContentElement.wizardItems.container.removeItems := addToList( {$ containerConfiguration ["cType " ]}) " ;
280- return $ pageTs . LF . $ content ;
278+ if ($ typo3Version ->getMajorVersion () > 12 ) {
279+ if ($ containerConfiguration ['registerInNewContentElementWizard ' ] === false ) {
280+ $ group = $ containerConfiguration ['group ' ] !== '' ? $ containerConfiguration ['group ' ] : $ defaultGroup ;
281+ $ cTypesByGroup [$ group ][] = $ cType ;
282+ }
283+ }
284+ }
285+
286+ if ($ typo3Version ->getMajorVersion () > 12 && !empty ($ cTypesByGroup )) {
287+ foreach ($ cTypesByGroup as $ group => $ ctypes ) {
288+ $ pageTs .= LF . 'mod.wizards.newContentElement.wizardItems. ' . $ group . '.removeItems := addToList( ' . implode (', ' , $ ctypes ) . ') ' ;
281289 }
290+ return $ pageTs ;
282291 }
283292
284293 foreach ($ groupedByGroup as $ group => $ containerConfigurations ) {
You can’t perform that action at this time.
0 commit comments