Skip to content

Commit

Permalink
Merge pull request #98 from humhub/fix/97-file-download-affects-updat…
Browse files Browse the repository at this point in the history
…ed_by

Don’t affect an update date and user on download counter action
  • Loading branch information
luke- authored Nov 9, 2020
2 parents 08e3bfe + ca34d05 commit 6d6bfae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ public static function onAfterFileAction(Event $event)
$event->action instanceof DownloadAction &&
($downloadedFile = File::getFileByGuid(Yii::$app->request->get('guid')))
) {
$downloadedFile->download_count++;
$downloadedFile->save();
$downloadedFile->updateAttributes(['download_count' => $downloadedFile->download_count + 1]);
}
}

Expand Down
5 changes: 5 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

0.12.1 - November 9, 2020
---------------------------
- Fix #97: Don’t affect an update date and user on download counter action


0.12.0 - November 4, 2020
--------------------------
- Enh #93: Wall Stream Layout Migration for HumHub 1.7+
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"organisation",
"sharing"
],
"version": "0.12.0",
"version": "0.12.1",
"humhub": {
"minVersion": "1.7"
},
Expand Down

0 comments on commit 6d6bfae

Please sign in to comment.