mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 12:11:19 +00:00
fix calling hook after uploading document
This commit is contained in:
parent
c427cde4bb
commit
31074ab8e7
|
@ -671,8 +671,8 @@ switch($command) {
|
|||
}
|
||||
}
|
||||
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['postAddDocument'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['postAddDocument'] as $hookObj) {
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['addDocument'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['addDocument'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'postAddDocument')) {
|
||||
$hookObj->postAddDocument($document);
|
||||
}
|
||||
|
@ -682,7 +682,15 @@ switch($command) {
|
|||
$index = $indexconf['Indexer']::open($settings->_luceneDir);
|
||||
if($index) {
|
||||
$indexconf['Indexer']::init($settings->_stopWordsFile);
|
||||
$index->addDocument(new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, !($filesize < $settings->_maxSizeForFullText)));
|
||||
$idoc = new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, !($filesize < $settings->_maxSizeForFullText));
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['addDocument'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['addDocument'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'preIndexDocument')) {
|
||||
$hookObj->preIndexDocument($document, $idoc);
|
||||
}
|
||||
}
|
||||
}
|
||||
$index->addDocument($idoc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user