mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-11 16:35:38 +00:00
always call hook postRemoveDocument and index document
This commit is contained in:
parent
5009a25439
commit
d9a8f35a6a
|
@ -47,20 +47,23 @@ class SeedDMS_Controller_RemoveDocument extends SeedDMS_Controller_Common {
|
|||
if (!$document->remove()) {
|
||||
$this->errormsg = "error_occured";
|
||||
return false;
|
||||
} else {
|
||||
|
||||
if(!$this->callHook('postRemoveDocument')) {
|
||||
}
|
||||
|
||||
/* Remove the document from the fulltext index */
|
||||
if($index) {
|
||||
$lucenesearch = new $indexconf['Search']($index);
|
||||
if($hit = $lucenesearch->getDocument($documentid)) {
|
||||
$index->delete($hit->id);
|
||||
$index->commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif($result === false) {
|
||||
if(empty($this->errormsg))
|
||||
$this->errormsg = 'hook_removeDocument_failed';
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Remove the document from the fulltext index */
|
||||
if($index) {
|
||||
$lucenesearch = new $indexconf['Search']($index);
|
||||
if($hit = $lucenesearch->getDocument($documentid)) {
|
||||
$index->delete($hit->id);
|
||||
$index->commit();
|
||||
}
|
||||
}
|
||||
|
||||
if(!$this->callHook('postRemoveDocument')) {
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue
Block a user