Skip to content

Commit

Permalink
Refresh name of a downloading renamed file
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed Jan 29, 2024
1 parent b7ea266 commit ed719a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
0.16.4 - Unreleased
---------------------------
- Fix #201: Fix replaced method `friendship\Module::isEnabled()`
- Fix #203: Refresh name of a downloading renamed file

0.16.3 - November 16, 2023
---------------------------
Expand Down
10 changes: 4 additions & 6 deletions models/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,10 @@ public function getFullUrl()
*/
public function getDownloadUrl($forceDownload = false, $scheme = true)
{
if(!$scheme) {
return DownloadFileHandler::getUrl($this->baseFile, $forceDownload);
} else {
// Todo can be removed after v1.2.3 then call DownloadFileHandler::getUrl($this->baseFile, $forceDownload, $scheme)
return Url::to(['/file/file/download', 'guid' => $this->baseFile->guid, 'download' => $forceDownload], $scheme);
}
return $this->baseFile->getUrl([
'download' => $forceDownload,
'hash_name' => substr(sha1($this->baseFile->file_name), 0, 4)
], $scheme);
}

/**
Expand Down

0 comments on commit ed719a5

Please sign in to comment.