mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 21:21:27 +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);
|
$idoc = new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout);
|
||||||
$error = $idoc->getErrorMsg();
|
$error = $idoc->getErrorMsg();
|
||||||
if(!$error) {
|
if(!$error) {
|
||||||
|
$ires = null;
|
||||||
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')) {
|
||||||
if(false !== ($ires = $hookObj->preIndexDocument(null, $document, $idoc))) {
|
$ires = $hookObj->preIndexDocument(null, $document, $idoc);
|
||||||
$ires = $index->addDocument($idoc);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(false !== $ires)
|
||||||
|
$ires = $index->addDocument($idoc);
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
if(false === $ires) {
|
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()));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user