Feature #97259
openAdd option to pass additionalFields to PageTreeRepository, when building the tree
0%
Description
Using the Hook $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Imaging\IconFactory::class]['overrideIconOverlay'] it is possible to modify the overlay-icon for icons created with the IconFactory class. But it is not possible to add custom overlays based on new fields (pages table) for the page-tree because the row will never contain the fields you added.
The PageTreeRepository can receive additional fields to select in the constructor but the TreeController does pass a hard-coded empty array.
The hook to midify the icon overlay:
https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Imaging/IconFactory.php#L361
PageTreeRepository instantiation responsible for loading the page record:
https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/Controller/Page/TreeController.php#L486
Query created by repository:
https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/Tree/Repository/PageTreeRepository.php#L520
What i want to achieve:
I simply added a field to the pages table to disable robots (recursive) for the page and all sub-pages. To show the setting to a logged in backend-user i want to display a overlay ontop of that page. Something like a stop-sign. At the moment there is no safe way (besides XClassing or firing a second query to fetch the new field inside the hook) of adding such a feature.
By adding a configuration like $GLOBALS['TYPO3_CONF_VARS']['BE']['pageTreeAdditionalFields'] and merging that field additionally inside the PageTreeRepository, this could be enhanced very easily.