[BUGFIX] Exclude uid '0' from any editing action in Info > Pagetree Overview 59/49659/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Mon, 29 Aug 2016 19:34:28 +0000 (21:34 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 30 Aug 2016 19:44:28 +0000 (21:44 +0200)
The module Info > Pagetree Overview offers the possibility to edit the
root page (uid 0) which is impossible as this is no real page.

The edit button for the row in the table representing the root page is
removed. The mass edit buttons in the table header don't allow to edit
that page anymore, too.

Resolves: #77678
Releases: master, 7.6
Change-Id: I7083c83372ad619ea8e8ffd2f53822bcd939d768
Reviewed-on: https://review.typo3.org/49659
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/View/PageLayoutView.php

index c9ffbfb..7be3559 100644 (file)
@@ -357,7 +357,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                 // Getting children:
                 $theRows = [];
                 $theRows = $this->pages_getTree($theRows, $row['uid'], $delClause . BackendUtility::versioningPlaceholderClause('pages'), '', $depth);
-                if ($this->getBackendUser()->doesUserHaveAccess($row, 2)) {
+                if ($this->getBackendUser()->doesUserHaveAccess($row, 2) && $row['uid'] > 0) {
                     $editUids[] = $row['uid'];
                 }
                 $out .= $this->pages_drawItem($row, $this->fieldArray);
@@ -1222,7 +1222,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                     $theData[$field] = $row[$field] ? '&nbsp;<strong>x</strong>' : '&nbsp;';
                     break;
                 case 'uid':
-                    if ($this->getBackendUser()->doesUserHaveAccess($row, 2)) {
+                    if ($this->getBackendUser()->doesUserHaveAccess($row, 2) && $row['uid'] > 0) {
                         $urlParameters = [
                             'edit' => [
                                 'pages' => [