Skip to content
Snippets Groups Projects
Commit 10e0a7cf authored by Georg Ringer's avatar Georg Ringer Committed by Sascha Egerer
Browse files

[BUGFIX] Use correct check to find site root pages

The change #79857 introduced a wrong check to find the
site root pages. Instead of checking pid == 0, the field
is_siteroot must be used.

Resolves: #79897
Releases: master
Change-Id: Ibfff703fc9506505f860c051f65dc3d31083eb1e
Reviewed-on: https://review.typo3.org/51756


Reviewed-by: default avatarAndreas Fernandez <typo3@scripting-base.de>
Tested-by: default avatarAndreas Fernandez <typo3@scripting-base.de>
Reviewed-by: default avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarThomas Hohn <thomas@hohn.dk>
Reviewed-by: default avatarSascha Egerer <sascha@sascha-egerer.de>
Tested-by: default avatarSascha Egerer <sascha@sascha-egerer.de>
Reviewed-by: default avatarJosef Glatz <josef.glatz@typo3.org>
Tested-by: default avatarJosef Glatz <josef.glatz@typo3.org>
parent c794fa27
Branches
Tags
No related merge requests found
......@@ -149,7 +149,7 @@ abstract class AbstractTreeView
* @see addField()
* @var array
*/
public $fieldArray = ['uid', 'pid', 'title'];
public $fieldArray = ['uid', 'pid', 'title', 'is_siteroot'];
/**
* List of other fields which are ALLOWED to set (here, based on the "pages" table!)
......@@ -689,7 +689,7 @@ abstract class AbstractTreeView
}
$title = $this->showDefaultTitleAttribute ? htmlspecialchars('UID: ' . $row['uid']) : $this->getTitleAttrib($row);
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$icon = $row['pid'] === 0 ? $iconFactory->getIcon('apps-pagetree-folder-root', Icon::SIZE_SMALL) : $iconFactory->getIconForRecord($this->table, $row, Icon::SIZE_SMALL);
$icon = $row['is_siteroot'] ? $iconFactory->getIcon('apps-pagetree-folder-root', Icon::SIZE_SMALL) : $iconFactory->getIconForRecord($this->table, $row, Icon::SIZE_SMALL);
$icon = '<span title="' . $title . '">' . $icon->render() . '</span>';
return $this->wrapIcon($icon, $row);
}
......
......@@ -27,6 +27,7 @@ class PageTreeView extends AbstractTreeView
public $fieldArray = [
'uid',
'pid',
'is_siteroot',
'title',
'doktype',
'nav_title',
......
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