Commit c99b3001 authored by Thomas Löffler's avatar Thomas Löffler

Uses the last version if no version string is given in download

parent ec385b89
Pipeline #2170 passed with stages
in 1 minute and 30 seconds
......@@ -425,14 +425,17 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
* @ignorevalidation $extension
* @return void
*/
public function downloadAction(\T3o\TerFe2\Domain\Model\Extension $extension, $versionString, $format)
public function downloadAction(\T3o\TerFe2\Domain\Model\Extension $extension, $versionString = '', $format = '')
{
if (!$format) {
$format = 't3x';
if ($format === '') {
$format = 'zip';
}
if ($format !== 't3x' && $format !== 'zip') {
throw new \Exception('A download action for the format "' . $format . '" is not implemented');
}
if ($versionString === '') {
$versionString = $extension->getLastVersion()->getVersionString();
}
$version = $this->versionRepository->findOneByExtensionAndVersionString($extension, $versionString);
if (!$version) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment