[TASK] List Module: Hide hidden fields in single table rendering 82/51282/3
authorGeorg Ringer <georg.ringer@gmail.com>
Thu, 12 Jan 2017 11:50:41 +0000 (12:50 +0100)
committerBenni Mack <benni@typo3.org>
Fri, 13 Jan 2017 14:35:28 +0000 (15:35 +0100)
If a field is hidden by using TsConfig, it should also not be
shown in the single table rendering in the record list.

Resolves: #79289
Releases: master
Change-Id: I0366c5ef5da260084367b9881f3a26ef60d5b319
Reviewed-on: https://review.typo3.org/51282
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index 5dccd9a..3de19b9 100644 (file)
@@ -1957,7 +1957,13 @@ class DatabaseRecordList extends AbstractDatabaseRecordList
         // Create a checkbox for each field:
         $checkboxes = [];
         $checkAllChecked = true;
+        $tsConfig = BackendUtility::getPagesTSconfig($this->id);
+        $tsConfigOfTable = is_array($tsConfig['TCEFORM.'][$table . '.']) ? $tsConfig['TCEFORM.'][$table . '.'] : null;
         foreach ($fields as $fieldName) {
+            // Hide field if hidden
+            if ($tsConfigOfTable && is_array($tsConfigOfTable[$fieldName . '.']) && isset($tsConfigOfTable[$fieldName . '.']['disabled']) && (int)$tsConfigOfTable[$fieldName . '.']['disabled'] === 1) {
+                continue;
+            }
             // Determine, if checkbox should be checked
             if (in_array($fieldName, $setFields, true) || $fieldName === $this->fieldArray[0]) {
                 $checked = ' checked="checked"';