Commit 9579d05d authored by Thomas Löffler's avatar Thomas Löffler

Merge branch '225-provide-download-of-last-version-and-zip-file-if-nothing-given' into 'develop'

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

Closes #225

See merge request !192
parents ec385b89 c99b3001
Pipeline #2175 passed with stages
in 2 minutes and 18 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