mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-15 14:11:35 +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'])) {
|
if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) {
|
||||||
foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) {
|
foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) {
|
||||||
if (method_exists($hookObj, 'preIndexDocument')) {
|
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');
|
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()));
|
echo json_encode(array('success'=>false, 'message'=>getMLText('error_document_indexed'), 'data'=>$document->getID()));
|
||||||
} else {
|
} else {
|
||||||
echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_indexed'), 'data'=>$document->getID(), 'cmd'=>$idoc->getCmd()));
|
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