[FOLLOWUP][BUGFIX] Remove hardcoded hidden column 92/47892/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Sun, 24 Apr 2016 17:54:13 +0000 (19:54 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 24 Apr 2016 18:41:39 +0000 (20:41 +0200)
Use processedTca instead of $GLOBALS access and improve
validation to avoid notice level errors.

Change-Id: I9f2f2a455875e509c16cad17e29e629e8b21fe6d
Resolves: #75647
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/47892
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php

index 2a38ab1..7cfdd82 100644 (file)
@@ -127,7 +127,10 @@ class InlineRecordContainer extends AbstractContainer
         $html = '';
         $combinationHtml = '';
         $isNewRecord = $data['command'] === 'new';
-        $hiddenField = $GLOBALS['TCA'][$foreignTable]['ctrl']['enablecolumns']['disabled'];
+        $hiddenField = '';
+        if (isset($data['processedTca']['ctrl']['enablecolumns']['disabled'])) {
+            $hiddenField = $data['processedTca']['ctrl']['enablecolumns']['disabled'];
+        }
         if (!$data['isInlineDefaultLanguageRecordInLocalizedParentContext']) {
             if ($isNewRecord || $data['isInlineChildExpanded']) {
                 // Render full content ONLY IF this is an AJAX request, a new record, or the record is not collapsed
@@ -181,7 +184,7 @@ class InlineRecordContainer extends AbstractContainer
             if ($data['isInlineDefaultLanguageRecordInLocalizedParentContext']) {
                 $class .= ' t3-form-field-container-inline-placeHolder';
             }
-            if (isset($record[$hiddenField]) && (int)$record[$hiddenField]) {
+            if (!empty($hiddenField) && isset($record[$hiddenField]) && (int)$record[$hiddenField]) {
                 $class .= ' t3-form-field-container-inline-hidden';
             }
             $class .= ($isNewRecord ? ' inlineIsNewRecord' : '');