mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
use the latestet version if no version is given
This commit is contained in:
parent
3f77722aa8
commit
d71d78138b
|
@ -30,7 +30,15 @@ class SeedDMS_Controller_Download extends SeedDMS_Controller_Common {
|
|||
case "version":
|
||||
$version = $this->params['version'];
|
||||
$document = $this->params['document'];
|
||||
$content = $document->getContentByVersion($version);
|
||||
if($version < 1) {
|
||||
$content = $this->callHook('documentLatestContent', $document);
|
||||
if($content === null)
|
||||
$content = $document->getLatestContent();
|
||||
} else {
|
||||
$content = $this->callHook('documentContent', $document, $version);
|
||||
if($content === null)
|
||||
$content = $document->getContentByVersion($version);
|
||||
}
|
||||
if (!is_object($content)) {
|
||||
$this->errormsg = 'invalid_version';
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue
Block a user