removeFromIndex() returns null, otherwise the removeFolder is canceled

This commit is contained in:
Uwe Steinmann 2018-04-11 17:35:59 +02:00
parent e060116c0c
commit e98dc5e4f2

View File

@ -43,7 +43,7 @@ class SeedDMS_Controller_RemoveFolder extends SeedDMS_Controller_Common {
$result = $this->callHook('removeFolder', $folder); $result = $this->callHook('removeFolder', $folder);
if($result === null) { if($result === null) {
/* Register a callback which removes each document from the fulltext index /* Register a callback which removes each document from the fulltext index
* The callback must return true other the removal will be canceled. * The callback must return null other the removal will be canceled.
*/ */
function removeFromIndex($arr, $document) { function removeFromIndex($arr, $document) {
$index = $arr[0]; $index = $arr[0];
@ -53,7 +53,7 @@ class SeedDMS_Controller_RemoveFolder extends SeedDMS_Controller_Common {
$index->delete($hit->id); $index->delete($hit->id);
$index->commit(); $index->commit();
} }
return true; return null;
} }
if($index) if($index)
$dms->setCallback('onPreRemoveDocument', 'removeFromIndex', array($index, $indexconf)); $dms->setCallback('onPreRemoveDocument', 'removeFromIndex', array($index, $indexconf));