From d210f64b08c144815af17f885739ad2a25e38a9a Mon Sep 17 00:00:00 2001 From: Jigal van Hemert Date: Thu, 18 Oct 2012 23:11:18 +0200 Subject: [PATCH] [BUGFIX] Download as zip must use same filename structure as TER Upload in EM assumes _.zip, so the download as zip feature must use the same format. Change-Id: Ide7eb7aac3c8f213b7db2bc9dad5e014e8faa666 Fixes: #42067 Release: 6.0 Reviewed-on: http://review.typo3.org/15801 Reviewed-by: Wouter Wolters Tested-by: Wouter Wolters Reviewed-by: Helmut Hummel Tested-by: Helmut Hummel --- .../Classes/Utility/FileHandlingUtility.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/typo3/sysext/extensionmanager/Classes/Utility/FileHandlingUtility.php b/typo3/sysext/extensionmanager/Classes/Utility/FileHandlingUtility.php index d36fa67a5897..8636ba248104 100644 --- a/typo3/sysext/extensionmanager/Classes/Utility/FileHandlingUtility.php +++ b/typo3/sysext/extensionmanager/Classes/Utility/FileHandlingUtility.php @@ -237,6 +237,18 @@ class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface { return $absolutePath; } + /** + * Get version of an available or installed extension + * + * @param string $extension + * @return string + */ + public function getExtensionVersion($extension) { + $extensionData = $this->installUtility->enrichExtensionWithDetails($extension); + $version = $extensionData['version']; + return $version; + } + /** * Create a zip file from an extension * @@ -245,7 +257,8 @@ class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface { */ public function createZipFileFromExtension($extension) { $extensionPath = $this->getAbsoluteExtensionPath($extension); - $fileName = PATH_site . 'typo3temp/' . $extension . '.zip'; + $version = $this->getExtensionVersion($extension); + $fileName = PATH_site . 'typo3temp/' . $extension . '_' . $version . '.zip'; $zip = new \ZipArchive(); $zip->open($fileName, \ZipArchive::CREATE); $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($extensionPath)); -- 2.20.1