[TASK] Add default icon overlay fields to rootline 30/59030/4
authorTim Karliczek <tkarliczek@3pc.de>
Tue, 4 Dec 2018 17:27:34 +0000 (18:27 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Mon, 10 Dec 2018 18:34:26 +0000 (19:34 +0100)
Add fields, which modify page icon rendering,
to default field list of rootline page requests.
Ensures more detailed rendering of page status icons
in FLUID using ViewHelper core:iconForRecord

Resolves: #87076
Releases: master
Change-Id: I11adbaa627c77ceaaa23ca28229510cb19936ad3
Reviewed-on: https://review.typo3.org/59030
Reviewed-by: Joerg Kummer <typo3@enobe.de>
Tested-by: Joerg Kummer <typo3@enobe.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php

index cf3c6b2..1e8a0df 100644 (file)
@@ -393,45 +393,39 @@ class BackendUtility
                     break;
                 }
             }
+            $fields = [
+                'uid',
+                'pid',
+                'title',
+                'doktype',
+                'slug',
+                'tsconfig_includes',
+                'TSconfig',
+                'is_siteroot',
+                't3ver_oid',
+                't3ver_wsid',
+                't3ver_state',
+                't3ver_stage',
+                'backend_layout_next_level',
+                'hidden',
+                'starttime',
+                'endtime',
+                'fe_group',
+                'nav_hide',
+                'content_from_pid',
+                'module',
+                'extendToSubpages'
+            ];
+            $fields = array_merge($fields, $additionalFields);
+            $rootPage = array_fill_keys($fields, null);
             if ($uid == 0) {
-                $theRowArray[] = [
-                    'uid' => 0,
-                    'pid' => null,
-                    'title' => '',
-                    'doktype' => null,
-                    'slug' => null,
-                    'tsconfig_includes' => null,
-                    'TSconfig' => null,
-                    'is_siteroot' => null,
-                    't3ver_oid' => null,
-                    't3ver_wsid' => null,
-                    't3ver_state' => null,
-                    't3ver_stage' => null,
-                    'backend_layout_next_level' => null,
-                    'hidden' => null
-                ];
+                $rootPage['uid'] = 0;
+                $theRowArray[] = $rootPage;
             }
             $c = count($theRowArray);
             foreach ($theRowArray as $val) {
                 $c--;
-                $fields = [
-                    'uid',
-                    'pid',
-                    'title',
-                    'doktype',
-                    'slug',
-                    'tsconfig_includes',
-                    'TSconfig',
-                    'is_siteroot',
-                    't3ver_oid',
-                    't3ver_wsid',
-                    't3ver_state',
-                    't3ver_stage',
-                    'backend_layout_next_level',
-                    'hidden'
-                ];
-                $fields = array_merge($fields, $additionalFields);
-                $output[$c] = array_intersect_key($val, array_combine($fields, $fields));
+                $output[$c] = array_intersect_key($val, $rootPage);
                 if (isset($val['_ORIG_pid'])) {
                     $output[$c]['_ORIG_pid'] = $val['_ORIG_pid'];
                 }
@@ -481,6 +475,13 @@ class BackendUtility
                     't3ver_stage',
                     'backend_layout_next_level',
                     'hidden',
+                    'starttime',
+                    'endtime',
+                    'fe_group',
+                    'nav_hide',
+                    'content_from_pid',
+                    'module',
+                    'extendToSubpages',
                     ...$additionalFields
                 )
                 ->from('pages')
index b4d6442..57275c3 100644 (file)
@@ -367,7 +367,7 @@ class TypoScriptTemplateModuleController
                 if (empty($record) || VersionState::cast($record['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)) {
                     continue;
                 }
-                $additionalFieldsForRootline = ['sorting', 'hidden', 'fe_group', 'starttime', 'endtime', 'shortcut', 'nav_hide', 'module', 'content_from_pid'];
+                $additionalFieldsForRootline = ['sorting', 'shortcut'];
                 $rootline = BackendUtility::BEgetRootLine($record['pid'], '', true, $additionalFieldsForRootline);
                 $this->setInPageArray($pArray, $rootline, $record);
             }