always call hook postRemoveDocument and index document

This commit is contained in:
Uwe Steinmann 2019-01-17 18:26:22 +01:00
parent 5009a25439
commit d9a8f35a6a

View File

@ -47,9 +47,11 @@ class SeedDMS_Controller_RemoveDocument extends SeedDMS_Controller_Common {
if (!$document->remove()) { if (!$document->remove()) {
$this->errormsg = "error_occured"; $this->errormsg = "error_occured";
return false; return false;
} else { }
} elseif($result === false) {
if(!$this->callHook('postRemoveDocument')) { if(empty($this->errormsg))
$this->errormsg = 'hook_removeDocument_failed';
return false;
} }
/* Remove the document from the fulltext index */ /* Remove the document from the fulltext index */
@ -60,7 +62,8 @@ class SeedDMS_Controller_RemoveDocument extends SeedDMS_Controller_Common {
$index->commit(); $index->commit();
} }
} }
}
if(!$this->callHook('postRemoveDocument')) {
} }
return true; return true;