Project

General

Profile

Actions

Bug #28857

closed

BackendConfigurationManager wrong implementation of getCurrentPageId

Added by Georg Ringer over 12 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2011-08-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

the current implementation is wrong

// get current site root
$rootPages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid', 'pages', 'deleted=0 AND hidden=0 AND is_siteroot=1', '', '', '1');
if (count($rootPages) > 0) {
    return $rootPages[0]['uid'];
}

    // get root template
$rootTemplates = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('pid', 'sys_template', 'deleted=0 AND hidden=0 AND root=1', '', '', '1');
if (count($rootTemplates) > 0) {
    return $rootTemplates[0]['pid'];
}

it just takes the 1st page with is_siteroot or with a template (with root=1).

this won't work when having more than one tree which is quite common when using TYPO3

Actions

Also available in: Atom PDF