Commit 06677c29 authored by Thomas Löffler's avatar Thomas Löffler

Merge branch '189-download-counter-doesn-t-work' into 'develop'

Updates version record in repository to save download

Closes #189

See merge request !193
parents 2a00f081 12584eed
Pipeline #2177 passed with stages
in 2 minutes and 17 seconds
......@@ -482,10 +482,11 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
if (!empty($this->settings['countDownloads'])) {
$extensionKey = $extension->getExtKey();
$downloads = $this->session->get('downloads');
$versionRepository = $this->objectManager->get(\T3o\TerFe2\Domain\Repository\VersionRepository::class);
if (empty($downloads) || !in_array($extensionKey, $downloads)) {
// Add +1 to download counter and save immediately
$version->incrementDownloadCounter();
$this->persistenceManager->persistAll();
$versionRepository->update($version);
// Add extension key to session
$downloads[] = $extensionKey;
......
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