mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 20:21:16 +00:00
index document even if hook preIndexDocument is not set
This commit is contained in:
parent
e1bd6605aa
commit
43c15ff399
|
@ -803,15 +803,16 @@ switch($command) {
|
|||
$idoc = new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout);
|
||||
$error = $idoc->getErrorMsg();
|
||||
if(!$error) {
|
||||
$ires = null;
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'preIndexDocument')) {
|
||||
if(false !== ($ires = $hookObj->preIndexDocument(null, $document, $idoc))) {
|
||||
$ires = $index->addDocument($idoc);
|
||||
}
|
||||
$ires = $hookObj->preIndexDocument(null, $document, $idoc);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(false !== $ires)
|
||||
$ires = $index->addDocument($idoc);
|
||||
header('Content-Type: application/json');
|
||||
if(false === $ires) {
|
||||
echo json_encode(array('success'=>false, 'message'=>getMLText('error_document_indexed'), 'data'=>$document->getID()));
|
||||
|
|
Loading…
Reference in New Issue
Block a user