[BUGFIX] Exclude uid '0' from any editing action in Info > Pagetree Overview 29/49629/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 14:26:08 +0000 (16:26 +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/49629
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Philipp Gampe <philipp.gampe@typo3.org>
Tested-by: Philipp Gampe <philipp.gampe@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/View/PageLayoutView.php

index b5c0eb7..0e88581 100644 (file)
@@ -372,7 +372,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
             if ($flag) {
                 // Getting children:
                 $theRows = $this->getPageRecordsRecursive($row['uid'], $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);
@@ -1340,7 +1340,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' => [