[BUGFIX] Show full folder path in file list title 63/38763/8
authorChristian Weiske <christian.weiske@netresearch.de>
Fri, 17 Apr 2015 15:25:29 +0000 (17:25 +0200)
committerFrans Saris <franssaris@gmail.com>
Wed, 20 May 2015 20:25:45 +0000 (22:25 +0200)
We have to use the name and cannot rely on the identifier, since
they can be random UUID values.

This also fixes a wrong folder name in the paste confirm message.

Change-Id: I092efdc5b666c9010717136bc063b155479eadab
Resolves: #64759
Releases: master, 6.2
Reviewed-on: http://review.typo3.org/38763
Reviewed-by: Christian Weiske <typo3@cweiske.de>
Tested-by: Christian Weiske <typo3@cweiske.de>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
typo3/sysext/core/Classes/Resource/Folder.php
typo3/sysext/filelist/Classes/FileList.php

index 774b5ac..a59e47d 100644 (file)
@@ -350,7 +350,7 @@ class ElementInformationController {
                                if ($name === 'storage') {
                                        $rowValue = $resourceObject->getStorage()->getName();
                                } elseif ($name === 'folder') {
-                                       $rowValue = $resourceObject->getParentFolder()->getIdentifier();
+                                       $rowValue = $resourceObject->getParentFolder()->getReadablePath();
                                }
                        } elseif (in_array($name, array('creation_date', 'modification_date'), TRUE)) {
                                $rowValue = BackendUtility::datetime($this->row[$name]);
index 93f15a2..38a1e24 100644 (file)
@@ -97,6 +97,24 @@ class Folder implements FolderInterface {
        }
 
        /**
+        * Returns the full path of this folder, from the root.
+        *
+        * @param string $rootId ID of the root folder, NULL to auto-detect
+        *
+        * @return string
+        */
+       public function getReadablePath($rootId = NULL) {
+               if ($rootId === NULL) {
+                       $rootId = $this->storage->getRootLevelFolder()->getIdentifier();
+               }
+               $readablePath = '';
+               if ($this->identifier !== $rootId) {
+                       $readablePath = $this->getParentFolder()->getReadablePath($rootId);
+               }
+               return $readablePath . $this->name . '/';
+       }
+
+       /**
         * Sets a new name of the folder
         * currently this does not trigger the "renaming process"
         * as the name is more seen as a label
index 5981376..9d1c296 100644 (file)
@@ -194,7 +194,7 @@ class FileList extends AbstractRecordList {
                $this->totalbytes = 0;
                $this->JScode = '';
                $this->HTMLcode = '';
-               $this->path = $folderObject->getIdentifier();
+               $this->path = $folderObject->getReadablePath();
                $this->sort = $sort;
                $this->sortRev = $sortRev;
                $this->firstElementNumber = $pointer;
@@ -235,7 +235,7 @@ class FileList extends AbstractRecordList {
                );
                // Makes the code for the folder icon in the top
                if ($folderObject) {
-                       $title = htmlspecialchars($folderObject->getIdentifier());
+                       $title = htmlspecialchars($folderObject->getReadablePath());
                        // Start compiling the HTML
                        // If this is some subFolder under the mount root....
                        if ($folderObject->getStorage()->isWithinFileMountBoundaries($folderObject)) {