From add79b47d1aaf5ee244265a75955bd5acc33b693 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 27 Feb 2019 11:56:33 +0100 Subject: [PATCH] fix syntax error, run update of index even if update hook was called before --- controllers/class.UpdateDocument.php | 31 +++++++++------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/controllers/class.UpdateDocument.php b/controllers/class.UpdateDocument.php index 09d93987a..602d5eea1 100644 --- a/controllers/class.UpdateDocument.php +++ b/controllers/class.UpdateDocument.php @@ -69,32 +69,21 @@ class SeedDMS_Controller_UpdateDocument extends SeedDMS_Controller_Common { } } - if($recipients['i']) { - foreach($recipients['i'] as $uid) { - if($u = $dms->getUser($uid)) { - $res = $contentResult->getContent()->addIndRecipient($u, $user); + if($recipients['i']) { + foreach($recipients['i'] as $uid) { + if($u = $dms->getUser($uid)) { + $res = $contentResult->getContent()->addIndRecipient($u, $user); + } } } - } - if($recipients['g']) { - foreach($recipients['g'] as $gid) { - if($g = $dms->getGroup($gid)) { - $res = $contentResult->getContent()->addGrpRecipient($g, $user); + if($recipients['g']) { + foreach($recipients['g'] as $gid) { + if($g = $dms->getGroup($gid)) { + $res = $contentResult->getContent()->addGrpRecipient($g, $user); + } } } - } - if($index) { - $lucenesearch = new $indexconf['Search']($index); - if($hit = $lucenesearch->getDocument((int) $document->getId())) { - $index->delete($hit->id); - } - $idoc = new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, !($filesize < $settings->_maxSizeForFullText)); - if(!$this->callHook('preIndexDocument', $document, $idoc)) { - } - - if(!$this->callHook('postUpdateDocument', $document, $contentResult->getContent())) { - } $content = $contentResult->getContent(); } else { $this->errormsg = 'error_update_document';