[BUGFIX] Use FAL object name directly in Filelist clipboard message 43/42343/7
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 7 Aug 2015 07:46:30 +0000 (09:46 +0200)
committerBenni Mack <benni@typo3.org>
Mon, 10 Aug 2015 07:26:27 +0000 (09:26 +0200)
There is no need to obtain file informations if only the name is
required, which is already available, so access it directly. This also
fixes the uncaught exception when copying a folder.

Resolves: #68813
Releases: master
Change-Id: I90131da29c48ad7d89978c54dc98aa5426641411
Reviewed-on: http://review.typo3.org/42343
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/backend/Classes/ClickMenu/ClickMenu.php
typo3/sysext/filelist/Classes/FileList.php

index ab7c4fd..f896b67 100644 (file)
@@ -942,9 +942,8 @@ class ClickMenu {
                                $selItem = reset($elArr);
                                $clickedFileOrFolder = ResourceFactory::getInstance()->retrieveFileOrFolderObject($combinedIdentifier);
                                $fileOrFolderInClipBoard = ResourceFactory::getInstance()->retrieveFileOrFolderObject($selItem);
-                               $fileInfo = $fileOrFolderInClipBoard->getStorage()->getFileInfoByIdentifier(substr(strstr($selItem, ':'), 1));
                                $elInfo = array(
-                                       $fileInfo['name'],
+                                       $fileOrFolderInClipBoard->getName(),
                                        $clickedFileOrFolder->getName(),
                                        $this->clipObj->currentMode()
                                );
index a657a77..3a636a9 100644 (file)
@@ -274,8 +274,7 @@ class FileList extends AbstractRecordList {
                                                if ($clipBoardElement instanceof Folder && $clipBoardElement->getStorage()->isWithinFolder($clipBoardElement, $folderObject)) {
                                                        $addPasteButton = FALSE;
                                                }
-                                               $fileInfo = $clipBoardElement->getStorage()->getFileInfoByIdentifier(substr(strstr($element, ':'), 1));
-                                               $elToConfirm[$key] = $fileInfo['name'];
+                                               $elToConfirm[$key] = $clipBoardElement->getName();
                                        }
                                        if ($addPasteButton) {
                                                $buttons['PASTE'] = '<a href="' . htmlspecialchars($this->clipObj->pasteUrl('_FILE', $folderObject->getCombinedIdentifier())) . '" onclick="return ' . htmlspecialchars($this->clipObj->confirmMsg('_FILE', $this->path, 'into', $elToConfirm)) . '" title="' . $this->getLanguageService()->getLL('clip_paste', TRUE) . '">' . $this->iconFactory->getIcon('actions-document-paste-after', Icon::SIZE_SMALL) . '</a>';
@@ -414,8 +413,7 @@ class FileList extends AbstractRecordList {
                                                        if ($clipBoardElement instanceof Folder && $clipBoardElement->getStorage()->isWithinFolder($clipBoardElement, $this->folderObject)) {
                                                                $addPasteButton = FALSE;
                                                        }
-                                                       $fileInfo = $clipBoardElement->getStorage()->getFileInfoByIdentifier(substr(strstr($element, ':'), 1));
-                                                       $elToConfirm[$key] = $fileInfo['name'];
+                                                       $elToConfirm[$key] = $clipBoardElement->getName();
                                                }
                                                if ($addPasteButton) {
                                                        $cells[] = '<a class="btn btn-default" href="' . htmlspecialchars($this->clipObj->pasteUrl('_FILE', $this->folderObject->getCombinedIdentifier())) . '" onclick="return ' . htmlspecialchars($this->clipObj->confirmMsg('_FILE', $this->path, 'into', $elToConfirm)) . '" title="' . $this->getLanguageService()->getLL('clip_paste', 1) . '">' . $this->iconFactory->getIcon('actions-document-paste-after', Icon::SIZE_SMALL) . '</a>';
@@ -858,8 +856,7 @@ class FileList extends AbstractRecordList {
                                if ($clipBoardElement instanceof Folder && $clipBoardElement->getStorage()->isWithinFolder($clipBoardElement, $fileOrFolderObject)) {
                                        $addPasteButton = FALSE;
                                }
-                               $fileInfo = $clipBoardElement->getStorage()->getFileInfoByIdentifier(substr(strstr($element, ':'), 1));
-                               $elToConfirm[$key] = $fileInfo['name'];
+                               $elToConfirm[$key] = $clipBoardElement->getName();
                        }
                        if ($addPasteButton) {
                                $cells[] = '<a class="btn btn-default" href="' . htmlspecialchars($this->clipObj->pasteUrl('_FILE', $fullIdentifier)) . '" onclick="return ' . htmlspecialchars($this->clipObj->confirmMsg('_FILE', $fullName, 'into', $elToConfirm)) . '" title="' . $this->getLanguageService()->getLL('clip_pasteInto', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-paste-into') . '</a>';