[BUGFIX] Only check 'CType' when removing items from NewContentElementWizard 97/48497/2
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 20 May 2016 15:28:55 +0000 (17:28 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Wed, 8 Jun 2016 07:31:09 +0000 (09:31 +0200)
Fix the behavior of keepItems in the NewContentElementWizard to only
remove invalid items based on the CType key. Without this patch any
invalid value in tt_content_defValues would result in the content
element being invisible in the wizard.

Change-Id: Iee4d13ff05088b9c71a9a8fb1d258766e97dcf75
Resolves: #76242
Related: #61114
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/48497
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php

index 7499a5d..eb8341f 100644 (file)
@@ -542,7 +542,7 @@ class NewContentElementController extends AbstractModule
                             );
                         }
                         $isNotInKeepItems = !empty($keepItems[$fN]) && !in_array($fV, $keepItems[$fN]);
-                        if ($authModeDeny || $fN === 'CType' && in_array($fV, $removeItems[$fN]) || $isNotInKeepItems) {
+                        if ($authModeDeny || $fN === 'CType' && (in_array($fV, $removeItems[$fN]) || $isNotInKeepItems)) {
                             // Remove element all together:
                             unset($wizardItems[$key]);
                             break;