From: Jigal van Hemert Date: Thu, 18 Oct 2012 21:11:18 +0000 (+0200) Subject: [BUGFIX] Download as zip must use same filename structure as TER X-Git-Tag: TYPO3_6-0-0rc1~132 X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff_plain/d210f64b08c144815af17f885739ad2a25e38a9a [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 --- 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));