mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 04:31:32 +00:00
do not index document if preIndexDocument returns false
This commit is contained in:
parent
e0bbc4bab5
commit
ba49c866cb
|
@ -806,12 +806,14 @@ switch($command) {
|
|||
if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'preIndexDocument')) {
|
||||
$hookObj->preIndexDocument(null, $document, $idoc);
|
||||
if(false !== ($ires = $hookObj->preIndexDocument(null, $document, $idoc))) {
|
||||
$ires = $index->addDocument($idoc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
header('Content-Type: application/json');
|
||||
if(false === $index->addDocument($idoc)) {
|
||||
if(false === $ires) {
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('error_document_indexed'), 'data'=>$document->getID()));
|
||||
} else {
|
||||
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_indexed'), 'data'=>$document->getID(), 'cmd'=>$idoc->getCmd()));
|
||||
|
|
Loading…
Reference in New Issue
Block a user