Commit d44856e5 authored by Christian Kuhn's avatar Christian Kuhn Committed by Wouter Wolters
Browse files

[TASK] Deprecate getTSConfigVal() and getTSConfigProp()

The patch deprecates BackendUserAuthentication->getTSConfigVal()
and ->getTSConfigProp() and adapts usages to rely on getTSConfig()
without arguments. The array nesting is done directly within
consuming code and is combined with ?? to a fallback value.
Advantages:
* Expensive and recursive string operations within
  getTSConfig() are not used anymore.
* The weird 'value' / 'property' based sub array
  juggling is gone.
* Full TSconfig path including fallback can be easily
  seen within consuming code
* Notice free array access using null coalescence operator

Change-Id: I6d5777ebd533dcfdc6018e0226bfb3e513cfa652
Resolves: #84993
Related: #84982
Releases: master
Reviewed-on: https://review.typo3.org/56953


Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
parent c38efee8
......@@ -47,7 +47,7 @@ class AdminPanelInitiator implements MiddlewareInterface
// Initialize admin panel since simulation settings are required here
$beUser = $GLOBALS['BE_USER'];
// set legacy config
$beUser->extAdminConfig = $beUser->getTSConfigProp('admPanel');
$beUser->extAdminConfig = $beUser->getTSConfig()['admPanel.'] ?? [];
$adminPanelConfiguration = $beUser->extAdminConfig;
if (isset($adminPanelConfiguration['enable.'])) {
foreach ($adminPanelConfiguration['enable.'] as $value) {
......
......@@ -39,7 +39,7 @@ abstract class AbstractModule implements AdminPanelModuleInterface
public function __construct()
{
$this->mainConfiguration = $this->getBackendUser()->getTSConfigProp('admPanel');
$this->mainConfiguration = $this->getBackendUser()->getTSConfig()['admPanel.'] ?? [];
}
/**
......
......@@ -74,11 +74,8 @@ class EditModule extends AbstractModule
*/
private function getPageModule(): string
{
$newPageModule = \trim(
(string)$this->getBackendUser()
->getTSConfigVal('options.overridePageModule')
);
return BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
$pageModule = \trim($this->getBackendUser()->getTSConfig()['options.']['overridePageModule'] ?? '');
return BackendUtility::isModuleSetInTBE_MODULES($pageModule) ? $pageModule : 'web_layout';
}
/**
......
......@@ -46,11 +46,12 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
public function __construct()
{
$this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/Toolbar/ClearCacheMenu');
$backendUser = $this->getBackendUser();
$isAdmin = $this->getBackendUser()->isAdmin();
$userTsConfig = $this->getBackendUser()->getTSConfig();
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
// Clear all page-related caches
if ($backendUser->isAdmin() || $backendUser->getTSConfigVal('options.clearCache.pages')) {
if ($isAdmin || $userTsConfig['options.']['clearCache.']['pages'] ?? false) {
$this->cacheActions[] = [
'id' => 'pages',
'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:flushPageCachesTitle',
......@@ -64,7 +65,9 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
// Clearing of all caches is only shown if explicitly enabled via TSConfig
// or if BE-User is admin and the TSconfig explicitly disables the possibility for admins.
// This is useful for big production systems where admins accidentally could slow down the system.
if ($backendUser->getTSConfigVal('options.clearCache.all') || ($backendUser->isAdmin() && $backendUser->getTSConfigVal('options.clearCache.all') !== '0')) {
if ($userTsConfig['options.']['clearCache.']['all'] ?? false
|| ($isAdmin && (bool)($userTsConfig['options.']['clearCache.']['all'] ?? true))
) {
$this->cacheActions[] = [
'id' => 'all',
'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:flushAllCachesTitle2',
......@@ -97,7 +100,7 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
return true;
}
foreach ($this->optionValues as $value) {
if ($backendUser->getTSConfigVal('options.clearCache.' . $value)) {
if ($backendUser->getTSConfig()['options.']['clearCache.'][$value] ?? false) {
return true;
}
}
......
......@@ -125,7 +125,7 @@ class ShortcutToolbarItem implements ToolbarItemInterface
*/
public function checkAccess()
{
return (bool)$this->getBackendUser()->getTSConfigVal('options.enableBookmarks');
return (bool)($this->getBackendUser()->getTSConfig()['options.']['enableBookmarks'] ?? false);
}
/**
......@@ -392,7 +392,7 @@ class ShortcutToolbarItem implements ToolbarItemInterface
$languageService = $this->getLanguageService();
$backendUser = $this->getBackendUser();
// Groups from TSConfig
$bookmarkGroups = $backendUser->getTSConfigProp('options.bookmarkGroups');
$bookmarkGroups = $backendUser->getTSConfig()['options.']['bookmarkGroups.'] ?? [];
if (is_array($bookmarkGroups) && !empty($bookmarkGroups)) {
foreach ($bookmarkGroups as $groupId => $label) {
if (!empty($label)) {
......
......@@ -114,13 +114,10 @@ class Clipboard
*/
public function initializeClipboard()
{
$userTsConfig = $this->getBackendUser()->getTSConfig();
// Get data
$clipData = $this->getBackendUser()->getModuleData('clipboard', $this->getBackendUser()->getTSConfigVal('options.saveClipboard') ? '' : 'ses');
// NumberTabs
$clNP = $this->getBackendUser()->getTSConfigVal('options.clipboardNumberPads');
if (MathUtility::canBeInterpretedAsInteger($clNP) && $clNP >= 0) {
$this->numberTabs = MathUtility::forceIntegerInRange($clNP, 0, 20);
}
$clipData = $this->getBackendUser()->getModuleData('clipboard', $userTsConfig['options.']['saveClipboard'] ? '' : 'ses');
$this->numberTabs = MathUtility::forceIntegerInRange((int)($userTsConfig['options.']['clipboardNumberPads'] ?? 3), 0, 20);
// Resets/reinstates the clipboard pads
$this->clipData['normal'] = is_array($clipData['normal']) ? $clipData['normal'] : [];
for ($a = 1; $a <= $this->numberTabs; $a++) {
......
......@@ -144,7 +144,11 @@ class AbstractProvider implements ProviderInterface
protected function initDisabledItems()
{
$TSkey = $this->table . ($this->context ? '.' . $this->context : '');
$this->disabledItems = GeneralUtility::trimExplode(',', $this->backendUser->getTSConfigVal('options.contextMenu.table.' . $TSkey . '.disableItems'), true);
$this->disabledItems = GeneralUtility::trimExplode(
',',
$this->backendUser->getTSConfig()['options.']['contextMenu.']['table.'][$TSkey . '.']['disableItems'] ?? '',
true
);
}
/**
......
......@@ -402,7 +402,7 @@ class PageProvider extends RecordProvider
protected function canClearCache(): bool
{
return !$this->isRoot()
&& ($this->backendUser->isAdmin() || $this->backendUser->getTSConfigVal('options.clearCache.pages'));
&& ($this->backendUser->isAdmin() || $this->backendUser->getTSConfig()['options.']['clearCache.']['pages'] ?? false);
}
/**
......
......@@ -460,9 +460,8 @@ class RecordProvider extends AbstractProvider
*/
protected function canShowHistory(): bool
{
$showHistoryTS = $this->backendUser->getTSConfig('options.showHistory');
$showHistory = (bool)trim($showHistoryTS['properties'][$this->table] ?? $showHistoryTS['value'] ?? '1');
return $showHistory;
$userTsConfig = $this->backendUser->getTSConfig();
return (bool)(\trim($userTsConfig['options.']['showHistory.'][$this->table] ?? $userTsConfig['options.']['showHistory'] ?? '1'));
}
/**
......
......@@ -391,7 +391,7 @@ class BackendController
$this->pageRenderer->addInlineSetting('DateTimePicker', 'DateFormat', $dateFormat);
// If another page module was specified, replace the default Page module with the new one
$newPageModule = trim($beUser->getTSConfigVal('options.overridePageModule'));
$newPageModule = trim($beUser->getTSConfig()['options.']['overridePageModule'] ?? '');
$pageModule = BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
if (!$beUser->check('modules', $pageModule)) {
$pageModule = '';
......@@ -432,6 +432,7 @@ class BackendController
protected function handlePageEditing()
{
$beUser = $this->getBackendUser();
$userTsConfig = $this->getBackendUser()->getTSConfig();
// EDIT page:
$editId = preg_replace('/[^[:alnum:]_]/', '', GeneralUtility::_GET('edit'));
if ($editId) {
......@@ -474,8 +475,8 @@ class BackendController
window.setTimeout("top.loadEditId(' . (int)$editRecord['uid'] . ');", 500);
';
// Checking page edit parameter:
if (!$beUser->getTSConfigVal('options.bookmark_onEditId_dontSetPageTree')) {
$bookmarkKeepExpanded = $beUser->getTSConfigVal('options.bookmark_onEditId_keepExistingExpanded');
if (!($userTsConfig['options.']['bookmark_onEditId_dontSetPageTree'] ?? false)) {
$bookmarkKeepExpanded = (bool)($userTsConfig['options.']['bookmark_onEditId_keepExistingExpanded'] ?? false);
// Expanding page tree:
BackendUtility::openPageTree((int)$editRecord['pid'], !$bookmarkKeepExpanded);
}
......
......@@ -647,7 +647,7 @@ class EditDocumentController
$tce->setControl($parsedBody['control'] ?? $queryParams['control'] ?? []);
// Set default values specific for the user
$TCAdefaultOverride = $beUser->getTSConfigProp('TCAdefaults');
$TCAdefaultOverride = $beUser->getTSConfig()['TCAdefaults.'] ?? null;
if (is_array($TCAdefaultOverride)) {
$tce->setDefaultsFromUserTS($TCAdefaultOverride);
}
......
......@@ -309,7 +309,8 @@ class LoginController implements LoggerAwareInterface
*/
protected function checkRedirect(ServerRequestInterface $request): void
{
if (empty($this->getBackendUserAuthentication()->user['uid'])) {
$backendUser = $this->getBackendUserAuthentication();
if (empty($backendUser->user['uid'])) {
return;
}
......@@ -331,7 +332,7 @@ class LoginController implements LoggerAwareInterface
// try it once again - that might be needed for auto login
$this->redirectToURL = 'index.php?commandLI=setCookie';
}
$redirectToUrl = (string)$this->getBackendUserAuthentication()->getTSConfigVal('auth.BE.redirectToURL');
$redirectToUrl = (string)($backendUser->getTSConfig()['auth.']['BE.']['redirectToURL'] ?? '');
if (empty($redirectToUrl)) {
// Based on the interface we set the redirect script
$parsedBody = $request->getParsedBody();
......@@ -351,8 +352,8 @@ class LoginController implements LoggerAwareInterface
$interface = '';
}
// store interface
$this->getBackendUserAuthentication()->uc['interfaceSetup'] = $interface;
$this->getBackendUserAuthentication()->writeUC();
$backendUser->uc['interfaceSetup'] = $interface;
$backendUser->writeUC();
$formProtection = FormProtectionFactory::get();
if (!$formProtection instanceof BackendFormProtection) {
......
......@@ -337,15 +337,14 @@ class NewRecordController
// Page-selection permission clause (reading)
$this->perms_clause = $beUser->getPagePermsClause(Permission::PAGE_SHOW);
// This will hide records from display - it has nothing to do with user rights!!
if ($pidList = $beUser->getTSConfigVal('options.hideRecords.pages')) {
if (!empty($pidList)) {
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('pages');
$this->perms_clause .= ' AND ' . $queryBuilder->expr()->notIn(
'pages.uid',
GeneralUtility::intExplode(',', $pidList)
);
}
$pidList = $beUser->getTSConfig()['options.']['hideRecords.']['pages'] ?? '';
if (!empty($pidList)) {
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('pages');
$this->perms_clause .= ' AND ' . $queryBuilder->expr()->notIn(
'pages.uid',
GeneralUtility::intExplode(',', $pidList)
);
}
// Setting GPvars:
$parsedBody = $request->getParsedBody();
......
......@@ -181,7 +181,7 @@ class NewMultiplePagesController
$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
// Set default TCA values specific for the user
$backendUser = $this->getBackendUser();
$tcaDefaultOverride = $backendUser->getTSConfigProp('TCAdefaults');
$tcaDefaultOverride = $backendUser->getTSConfig()['TCAdefaults.'] ?? null;
if (is_array($tcaDefaultOverride)) {
$dataHandler->setDefaultsFromUserTS($tcaDefaultOverride);
}
......
......@@ -106,7 +106,7 @@ class TreeController
public function __construct()
{
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$this->useNavTitle = (bool)$this->getBackendUser()->getTSConfigVal('options.pageTree.showNavTitle');
$this->useNavTitle = (bool)($this->getBackendUser()->getTSConfig()['options.']['pageTree.']['showNavTitle'] ?? false);
}
/**
......@@ -136,6 +136,7 @@ class TreeController
*/
protected function getDokTypes(): array
{
$backendUser = $this->getBackendUser();
$doktypeLabelMap = [];
foreach ($GLOBALS['TCA']['pages']['columns']['doktype']['config']['items'] as $doktypeItemConfig) {
if ($doktypeItemConfig[1] === '--div--') {
......@@ -143,10 +144,10 @@ class TreeController
}
$doktypeLabelMap[$doktypeItemConfig[1]] = $doktypeItemConfig[0];
}
$doktypes = GeneralUtility::intExplode(',', $this->getBackendUser()->getTSConfigVal('options.pageTree.doktypesToShowInNewPageDragArea'), true);
$doktypes = GeneralUtility::intExplode(',', $backendUser->getTSConfig()['options.']['pageTree.']['doktypesToShowInNewPageDragArea'] ?? '', true);
$output = [];
$allowedDoktypes = GeneralUtility::intExplode(',', $this->getBackendUser()->groupData['pagetypes_select'], true);
$isAdmin = $this->getBackendUser()->isAdmin();
$allowedDoktypes = GeneralUtility::intExplode(',', $backendUser->groupData['pagetypes_select'], true);
$isAdmin = $backendUser->isAdmin();
// Early return if backend user may not create any doktype
if (!$isAdmin && empty($allowedDoktypes)) {
return $output;
......@@ -174,11 +175,12 @@ class TreeController
*/
public function fetchDataAction(ServerRequestInterface $request): ResponseInterface
{
$this->hiddenRecords = GeneralUtility::intExplode(',', $this->getBackendUser()->getTSConfigVal('options.hideRecords.pages'), true);
$this->backgroundColors = $this->getBackendUser()->getTSConfigProp('options.pageTree.backgroundColor');
$this->addIdAsPrefix = (bool)$this->getBackendUser()->getTSConfigVal('options.pageTree.showPageIdWithTitle');
$this->addDomainName = (bool)$this->getBackendUser()->getTSConfigVal('options.pageTree.showDomainNameWithTitle');
$this->showMountPathAboveMounts = (bool)$this->getBackendUser()->getTSConfigVal('options.pageTree.showPathAboveMounts');
$userTsConfig = $this->getBackendUser()->getTSConfig();
$this->hiddenRecords = GeneralUtility::intExplode(',', $userTsConfig['options.']['hideRecords.']['pages'] ?? '', true);
$this->backgroundColors = $userTsConfig['options.']['pageTree.']['backgroundColor.'] ?? [];
$this->addIdAsPrefix = (bool)($userTsConfig['options.']['pageTree.']['showPageIdWithTitle'] ?? false);
$this->addDomainName = (bool)($userTsConfig['options.']['pageTree.']['showDomainNameWithTitle'] ?? false);
$this->showMountPathAboveMounts = (bool)($userTsConfig['options.']['pageTree.']['showPathAboveMounts'] ?? false);
$backendUserConfiguration = GeneralUtility::makeInstance(BackendUserConfiguration::class);
$this->expandedState = $backendUserConfiguration->get('BackendComponents.States.Pagetree');
if (is_object($this->expandedState->stateHash)) {
......
......@@ -228,7 +228,7 @@ class SimpleDataHandlerController
if ($beUser->uc['neverHideAtCopy']) {
$this->tce->neverHideAtCopy = 1;
}
$TCAdefaultOverride = $beUser->getTSConfigProp('TCAdefaults');
$TCAdefaultOverride = $beUser->getTSConfig()['TCAdefaults.'] ?? null;
if (is_array($TCAdefaultOverride)) {
$this->tce->setDefaultsFromUserTS($TCAdefaultOverride);
}
......
......@@ -15,8 +15,11 @@ namespace TYPO3\CMS\Backend\Domain\Repository\Module;
*/
use TYPO3\CMS\Backend\Module\ModuleLoader;
use TYPO3\CMS\Backend\Routing\UriBuilder;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Imaging\IconRegistry;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
......@@ -211,16 +214,6 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface
}
}
/**
* Return language service instance
*
* @return \TYPO3\CMS\Core\Localization\LanguageService
*/
protected function getLanguageService()
{
return $GLOBALS['LANG'];
}
/**
* loads the module menu from the moduleloader based on $GLOBALS['TBE_MODULES']
* and compiles an array with all the data needed for menu etc.
......@@ -240,8 +233,7 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface
// Unset modules that are meant to be hidden from the menu.
$loadedModules = $this->removeHiddenModules($loadedModules);
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$dummyScript = (string)$uriBuilder->buildUriFromRoute('dummy');
foreach ($loadedModules as $moduleName => $moduleData) {
$moduleLink = '';
......@@ -317,22 +309,21 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface
*/
protected function removeHiddenModules($loadedModules)
{
$hiddenModules = $GLOBALS['BE_USER']->getTSConfig('options.hideModules');
$userTsConfig = $this->getBackendUser()->getTSConfig();
// Hide modules if set in userTS.
if (!empty($hiddenModules['value'])) {
$hiddenMainModules = explode(',', $hiddenModules['value']);
foreach ($hiddenMainModules as $hiddenMainModule) {
unset($loadedModules[trim($hiddenMainModule)]);
}
$hiddenMainModules = GeneralUtility::trimExplode(',', $userTsConfig['options.']['hideModules'] ?? '', true);
foreach ($hiddenMainModules as $hiddenMainModule) {
unset($loadedModules[$hiddenMainModule]);
}
// Hide sub-modules if set in userTS.
if (!empty($hiddenModules['properties']) && is_array($hiddenModules['properties'])) {
foreach ($hiddenModules['properties'] as $mainModuleName => $subModules) {
$hiddenSubModules = explode(',', $subModules);
$hiddenModules = $userTsConfig['options.']['hideModules.'] ?? [];
if (is_array($hiddenModules)) {
foreach ($hiddenModules as $mainModuleName => $subModules) {
$hiddenSubModules = GeneralUtility::trimExplode(',', $subModules, true);
foreach ($hiddenSubModules as $hiddenSubModule) {
unset($loadedModules[$mainModuleName]['sub'][trim($hiddenSubModule)]);
unset($loadedModules[$mainModuleName]['sub'][$hiddenSubModule]);
}
}
}
......@@ -359,4 +350,22 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface
}
return '';
}
/**
* Return language service instance
*
* @return LanguageService
*/
protected function getLanguageService()
{
return $GLOBALS['LANG'];
}
/**
* @return BackendUserAuthentication
*/
protected function getBackendUser(): BackendUserAuthentication
{
return $GLOBALS['BE_USER'];
}
}
......@@ -218,18 +218,18 @@ class FormResultCompiler
}
}
$pageRenderer->loadJquery();
$beUserAuth = $this->getBackendUserAuthentication();
$backendUser = $this->getBackendUserAuthentication();
// define the window size of the element browser etc.
$popupWindowWidth = 800;
$popupWindowHeight = 600;
$popupWindowSize = trim($beUserAuth->getTSConfigVal('options.popupWindowSize'));
$popupWindowSize = trim($backendUser->getTSConfig()['options.']['popupWindowSize'] ?? '');
if (!empty($popupWindowSize)) {
list($popupWindowWidth, $popupWindowHeight) = GeneralUtility::intExplode('x', $popupWindowSize);
}
// define the window size of the popups within the RTE
$rtePopupWindowSize = trim($beUserAuth->getTSConfigVal('options.rte.popupWindowSize'));
$rtePopupWindowSize = trim($backendUser->getTSConfig()['options.']['rte.']['popupWindowSize'] ?? '');
if (!empty($rtePopupWindowSize)) {
list($rtePopupWindowWidth, $rtePopupWindowHeight) = GeneralUtility::trimExplode('x', $rtePopupWindowSize);
}
......@@ -238,7 +238,7 @@ class FormResultCompiler
// Make textareas resizable and flexible ("autogrow" in height)
$textareaSettings = [
'autosize' => (bool)$beUserAuth->uc['resizeTextareas_Flexible'],
'autosize' => (bool)$backendUser->uc['resizeTextareas_Flexible'],
'RTEPopupWindow' => [
'width' => $rtePopupWindowWidth,
'height' => $rtePopupWindowHeight
......
......@@ -1070,7 +1070,9 @@ abstract class AbstractTreeView
foreach ($rootline as $rootlineElement) {
$record = BackendUtility::getRecordWSOL('pages', $rootlineElement['uid'], 'title, nav_title', '', true, true);
$text = $record['title'];
if ((bool)$this->getBackendUser()->getTSConfigVal('options.pageTree.showNavTitle') && trim($record['nav_title'] ?? '') !== '') {
if ((bool)($this->getBackendUser()->getTSConfig()['options.']['pageTree.']['showNavTitle'] ?? false)
&& trim($record['nav_title'] ?? '') !== ''
) {
$text = $record['nav_title'];
}
$path[] = htmlspecialchars($text);
......
......@@ -81,17 +81,19 @@ class BrowseTreeView extends AbstractTreeView
*/
public function init($clause = '', $orderByFields = '')
{
$backendUser = $this->getBackendUser();
// This will hide records from display - it has nothing to do with user rights!!
$clauseExcludePidList = '';
if ($pidList = $this->getBackendUser()->getTSConfigVal('options.hideRecords.pages')) {
$pidList = $backendUser->getTSConfig()['options.']['hideRecords.']['pages'] ?? '';
if (!empty($pidList)) {
if ($pidList = implode(',', GeneralUtility::intExplode(',', $pidList))) {
$clauseExcludePidList = ' AND pages.uid NOT IN (' . $pidList . ')';
}
}
// This is very important for making trees of pages: Filtering out deleted pages, pages with no access to and sorting them correctly:
parent::init(' AND deleted=0 AND sys_language_uid=0 AND ' . $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW) . ' ' . $clause . $clauseExcludePidList, 'sorting');
parent::init(' AND deleted=0 AND sys_language_uid=0 AND ' . $backendUser->getPagePermsClause(Permission::PAGE_SHOW) . ' ' . $clause . $clauseExcludePidList, 'sorting');
$this->title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
$this->MOUNTS = $this->getBackendUser()->returnWebmounts();
$this->MOUNTS = $backendUser->returnWebmounts();
if ($pidList) {
// Remove mountpoint if explicitly set in options.hideRecords.pages (see above)
$hideList = explode(',', $pidList);
......@@ -148,7 +150,9 @@ class BrowseTreeView extends AbstractTreeView
} else {
$title = parent::getTitleStr($row, $titleLen);
}
if (!empty($row['is_siteroot']) && $this->getBackendUser()->getTSConfigVal('options.pageTree.showDomainNameWithTitle')) {
if (!empty($row['is_siteroot'])
&& $this->getBackendUser()->getTSConfig()['options.']['pageTree.']['showDomainNameWithTitle'] ?? false
) {
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_domain');
$row = $queryBuilder
->select('domainName', 'sorting')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment