[TASK] Fix missing variable initialization in AbstractTreeView 27/51527/2
authorMarkus Klein <markus.klein@typo3.org>
Fri, 3 Feb 2017 20:42:34 +0000 (21:42 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Fri, 3 Feb 2017 20:45:53 +0000 (21:45 +0100)
https://review.typo3.org/49750 introduced code that lacks proper
variable initialization.
Get this straight.

Resolves: #79620
Releases: master, 7.6
Change-Id: I1b5735807f7f0fc476a5370f23d6b7d4654e4599
Reviewed-on: https://review.typo3.org/51527
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/backend/Classes/Tree/View/AbstractTreeView.php

index 0024b38..a1fd88e 100644 (file)
@@ -16,6 +16,7 @@ namespace TYPO3\CMS\Backend\Tree\View;
 
 use TYPO3\CMS\Backend\Routing\Router;
 use TYPO3\CMS\Backend\Routing\UriBuilder;
+use TYPO3\CMS\Backend\Tree\Pagetree\Commands;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Database\ConnectionPool;
@@ -64,6 +65,11 @@ abstract class AbstractTreeView
      */
     public $ext_IconMode = false;
 
+    /**
+     * @var bool
+     */
+    public $ext_showPathAboveMounts = false;
+
     // If set, the id of the mounts will be added to the internal ids array
     /**
      * @var int
@@ -375,6 +381,7 @@ abstract class AbstractTreeView
         // Get stored tree structure AND updating it if needed according to incoming PM GET var.
         $this->initializePositionSaving();
         // Init done:
+        $lastMountPointPid = 0;
         $treeArr = [];
         // Traverse mounts:
         foreach ($this->MOUNTS as $idx => $uid) {
@@ -399,7 +406,7 @@ abstract class AbstractTreeView
                 if ($this->ext_showPathAboveMounts) {
                     $mountPointPid = $rootRec['pid'];
                     if ($lastMountPointPid !== $mountPointPid) {
-                        $title = \TYPO3\CMS\Backend\Tree\Pagetree\Commands::getMountPointPath($mountPointPid);
+                        $title = Commands::getMountPointPath($mountPointPid);
                         $this->tree[] = ['isMountPointPath' => true, 'title' => $title];
                     }
                     $lastMountPointPid = $mountPointPid;
@@ -538,7 +545,7 @@ abstract class AbstractTreeView
      * Wrapping $title in a-tags.
      *
      * @param string $title Title string
-     * @param string $row Item record
+     * @param array $row Item record
      * @param int $bank Bank pointer (which mount point number)
      * @return string
      * @access private