mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
catch error if document cannot be updated (Closes #410)
This commit is contained in:
parent
0c0ac23576
commit
4c3e7acdeb
|
@ -59,7 +59,7 @@ class SeedDMS_Controller_UpdateDocument extends SeedDMS_Controller_Common {
|
||||||
$result = $this->callHook('updateDocument');
|
$result = $this->callHook('updateDocument');
|
||||||
if($result === null) {
|
if($result === null) {
|
||||||
$filesize = SeedDMS_Core_File::fileSize($userfiletmp);
|
$filesize = SeedDMS_Core_File::fileSize($userfiletmp);
|
||||||
$contentResult=$document->addContent($comment, $user, $userfiletmp, utf8_basename($userfilename), $filetype, $userfiletype, $reviewers, $approvers, $version=0, $attributes, $workflow);
|
if($contentResult=$document->addContent($comment, $user, $userfiletmp, utf8_basename($userfilename), $filetype, $userfiletype, $reviewers, $approvers, $version=0, $attributes, $workflow)) {
|
||||||
|
|
||||||
if ($this->hasParam('expires')) {
|
if ($this->hasParam('expires')) {
|
||||||
if($document->setExpires($this->getParam('expires'))) {
|
if($document->setExpires($this->getParam('expires'))) {
|
||||||
|
@ -82,6 +82,10 @@ class SeedDMS_Controller_UpdateDocument extends SeedDMS_Controller_Common {
|
||||||
if(!$this->callHook('postUpdateDocument', $document, $contentResult->getContent())) {
|
if(!$this->callHook('postUpdateDocument', $document, $contentResult->getContent())) {
|
||||||
}
|
}
|
||||||
$result = $contentResult->getContent();
|
$result = $contentResult->getContent();
|
||||||
|
} else {
|
||||||
|
$this->errormsg = 'error_update_document';
|
||||||
|
$result = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user