return error if postAddDocument fails

This commit is contained in:
Uwe Steinmann 2020-12-14 07:52:39 +01:00
parent e91dd1c09c
commit a3d92f5b72

View File

@ -133,7 +133,7 @@ class SeedDMS_Controller_AddDocument extends SeedDMS_Controller_Common {
if($document->getGroupAccessMode($notgroup) >= M_READ) if($document->getGroupAccessMode($notgroup) >= M_READ)
$res = $document->addNotify($notgroup->getID(), false); $res = $document->addNotify($notgroup->getID(), false);
} }
} elseif($result === false) { } elseif($document === false) {
if(empty($this->errormsg)) if(empty($this->errormsg))
$this->errormsg = 'hook_addDocument_failed'; $this->errormsg = 'hook_addDocument_failed';
return false; return false;
@ -147,7 +147,10 @@ class SeedDMS_Controller_AddDocument extends SeedDMS_Controller_Common {
} }
} }
if(!$this->callHook('postAddDocument', $document)) { if(false ==== $this->callHook('postAddDocument', $document)) {
if(empty($this->errormsg))
$this->errormsg = 'hook_postAddDocument_failed';
return false;
} }
return $document; return $document;