[BUGFIX] Only check 'CType' when removing items from NewContentElementWizard 26/48226/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:30:52 +0000 (09:30 +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.

Resolves: #76242
Related: #61114
Releases: master, 7.6
Change-Id: I31af8e8e7f095d3af01740165900474d7e05a9a5
Reviewed-on: https://review.typo3.org/48226
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
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 013a564..23bffd3 100644 (file)
@@ -519,7 +519,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;