From e09e2b6e4726c71200d952787c43749f1004bbf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=A3=D1=82=D0=BA=D0=B8=D0=BD?= Date: Mon, 5 Oct 2015 12:42:29 +0300 Subject: [PATCH] Downloads related to Package (not Release) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit По-моему, считать загрузки надо у самого компонента, а не у каждого выпуска в отдельности. Иначе счетчик загрузок будет обнуляться при выпуске новой версии --- .../modxrepository/processors/rest/download/index.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/components/modxrepository/processors/rest/download/index.class.php b/core/components/modxrepository/processors/rest/download/index.class.php index d687925..ae06721 100644 --- a/core/components/modxrepository/processors/rest/download/index.class.php +++ b/core/components/modxrepository/processors/rest/download/index.class.php @@ -57,7 +57,7 @@ function getFileUrl($id){ // Count downloads if( !empty($package['r_content_id']) - AND $resource = $this->modx->getObject('modResource', $package['r_content_id']) + AND $resource = $this->modx->getObject('modResource', $package['id']) ){ $count = (int)$resource->getTVValue('downloads'); $resource->setTVValue('downloads', $count + 1);