[FOLLOWUP][BUGFIX] Show full folder path in file list title 67/39767/3
authorFrans Saris <franssaris@gmail.com>
Thu, 28 May 2015 06:57:26 +0000 (08:57 +0200)
committerFrank Nägler <typo3@naegler.net>
Fri, 29 May 2015 09:54:20 +0000 (11:54 +0200)
In old situation the full path to of the folder was shown.
With #64759 only the accessible part is shown. The logic
to determine what the root is of the 'current' filemount
is not suitable for this and will always return the root path of
the first filemount within the storage. This could result in a wrong
root identifier.

This patch fixes the output of the readable path to the
full path by using the real storage root instead of the storage root
defined by the filemount.

Resolves: #67148
Related: #64759
Releases: master, 6.2
Change-Id: Ie00fa2dc7d3833f798c5a2913bb9674b2b15b6e7
Reviewed-on: http://review.typo3.org/39767
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Frank Nägler <typo3@naegler.net>
Tested-by: Frank Nägler <typo3@naegler.net>
typo3/sysext/core/Classes/Resource/Folder.php
typo3/sysext/core/Classes/Resource/ResourceStorage.php

index 38a1e24..df25aed 100644 (file)
@@ -104,13 +104,16 @@ class Folder implements FolderInterface {
         * @return string
         */
        public function getReadablePath($rootId = NULL) {
+               $oldPermissionFlag = $this->getStorage()->getEvaluatePermissions();
+               $this->getStorage()->setEvaluatePermissions(FALSE);
                if ($rootId === NULL) {
-                       $rootId = $this->storage->getRootLevelFolder()->getIdentifier();
+                       $rootId = $this->storage->getRootLevelFolder(FALSE)->getIdentifier();
                }
                $readablePath = '';
                if ($this->identifier !== $rootId) {
                        $readablePath = $this->getParentFolder()->getReadablePath($rootId);
                }
+               $this->getStorage()->setEvaluatePermissions($oldPermissionFlag);
                return $readablePath . $this->name . '/';
        }
 
index 5608581..9f50429 100644 (file)
@@ -2147,12 +2147,14 @@ class ResourceStorage implements ResourceStorageInterface {
 
        /**
         * Returns the folders on the root level of the storage
-        * or the first mount point of this storage for this user.
+        * or the first mount point of this storage for this user
+        * if $respectFileMounts is set.
         *
+        * @param bool $respectFileMounts
         * @return Folder
         */
-       public function getRootLevelFolder() {
-               if (count($this->fileMounts)) {
+       public function getRootLevelFolder($respectFileMounts = TRUE) {
+               if ($respectFileMounts && count($this->fileMounts)) {
                        $mount = reset($this->fileMounts);
                        return $mount['folder'];
                } else {