mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 05:01:43 +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'])) {
|
if(isset($GLOBALS['SEEDDMS_HOOKS']['addDocument'])) {
|
||||||
foreach($GLOBALS['SEEDDMS_HOOKS']['postAddDocument'] as $hookObj) {
|
foreach($GLOBALS['SEEDDMS_HOOKS']['addDocument'] as $hookObj) {
|
||||||
if (method_exists($hookObj, 'postAddDocument')) {
|
if (method_exists($hookObj, 'postAddDocument')) {
|
||||||
$hookObj->postAddDocument($document);
|
$hookObj->postAddDocument($document);
|
||||||
}
|
}
|
||||||
|
@ -682,7 +682,15 @@ switch($command) {
|
||||||
$index = $indexconf['Indexer']::open($settings->_luceneDir);
|
$index = $indexconf['Indexer']::open($settings->_luceneDir);
|
||||||
if($index) {
|
if($index) {
|
||||||
$indexconf['Indexer']::init($settings->_stopWordsFile);
|
$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