Fixed usage of deprecated SearchIndexManager methods
authorMarcel Werk <burntime@woltlab.com>
Fri, 15 Jul 2016 11:48:50 +0000 (13:48 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 15 Jul 2016 11:48:50 +0000 (13:48 +0200)
wcfsetup/install/files/lib/data/article/ArticleAction.class.php
wcfsetup/install/files/lib/system/search/SearchIndexManager.class.php
wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php

index a43096e058a28669f03c90e8286e1abe7a40dddb..40346f132c6fb978badc776cc831659f5e563762 100644 (file)
@@ -81,7 +81,7 @@ class ArticleAction extends AbstractDatabaseObjectAction {
                                }
                                
                                // update search index
-                               SearchIndexManager::getInstance()->add('com.woltlab.wcf.article', $articleContent->articleContentID, $articleContent->content, $articleContent->title, $article->time, $article->userID, $article->username, ($languageID ?: null), $articleContent->teaser);
+                               SearchIndexManager::getInstance()->set('com.woltlab.wcf.article', $articleContent->articleContentID, $articleContent->content, $articleContent->title, $article->time, $article->userID, $article->username, ($languageID ?: null), $articleContent->teaser);
                                
                                // save embedded objects
                                if (!empty($content['htmlInputProcessor'])) {
@@ -149,7 +149,7 @@ class ArticleAction extends AbstractDatabaseObjectAction {
                                        }
                                        
                                        // update search index
-                                       SearchIndexManager::getInstance()->add('com.woltlab.wcf.article', $articleContent->articleContentID, $articleContent->content, $articleContent->title, $article->time, $article->userID, $article->username, ($languageID ?: null), $articleContent->teaser);
+                                       SearchIndexManager::getInstance()->set('com.woltlab.wcf.article', $articleContent->articleContentID, $articleContent->content, $articleContent->title, $article->time, $article->userID, $article->username, ($languageID ?: null), $articleContent->teaser);
                                        
                                        // save embedded objects
                                        if (!empty($content['htmlInputProcessor'])) {
index 7868fa558b3bcd16e67b410227828efa41cd83b0..d1fba778837aa2d150abdf2a85a8be2e7ae9c83e 100644 (file)
@@ -108,16 +108,18 @@ class SearchIndexManager extends SingletonFactory implements ISearchIndexManager
        
        /**
         * @inheritDoc
+        * @deprecated  3.0 - please use `set() instead`
         */
        public function add($objectType, $objectID, $message, $subject, $time, $userID, $username, $languageID = null, $metaData = '') {
-               $this->getSearchIndexManager()->add($objectType, $objectID, $message, $subject, $time, $userID, $username, $languageID, $metaData);
+               $this->set($objectType, $objectID, $message, $subject, $time, $userID, $username, $languageID, $metaData);
        }
        
        /**
         * @inheritDoc
+        * @deprecated  3.0 - please use `set() instead`
         */
        public function update($objectType, $objectID, $message, $subject, $time, $userID, $username, $languageID = null, $metaData = '') {
-               $this->getSearchIndexManager()->update($objectType, $objectID, $message, $subject, $time, $userID, $username, $languageID, $metaData);
+               $this->set($objectType, $objectID, $message, $subject, $time, $userID, $username, $languageID, $metaData);
        }
        
        /**
index 217d28066e752f40433a3edff64787a8a8bd9a75..681ae73450ca463e5335b3eced34a04fb6a28151 100644 (file)
@@ -73,7 +73,7 @@ class ArticleRebuildDataWorker extends AbstractRebuildDataWorker {
                        $comments[$articleContent->articleID] += $row['comments'] + $row['responses'];
                        
                        // update search index
-                       SearchIndexManager::getInstance()->add('com.woltlab.wcf.article', $articleContent->articleContentID, $articleContent->content, $articleContent->title, $articles[$articleContent->articleID]->time, $articles[$articleContent->articleID]->userID, $articles[$articleContent->articleID]->username, $articleContent->languageID, $articleContent->teaser);
+                       SearchIndexManager::getInstance()->set('com.woltlab.wcf.article', $articleContent->articleContentID, $articleContent->content, $articleContent->title, $articles[$articleContent->articleID]->time, $articles[$articleContent->articleID]->userID, $articles[$articleContent->articleID]->username, $articleContent->languageID, $articleContent->teaser);
                }
                
                // fetch cumulative likes