diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 16c1665..0b16a59 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,10 @@ Changelog ========= +2.2.0 (Unreleased) +--------------------- +- Fix #325: Update to new search indexing + 2.1.1 (April 1, 2024) --------------------- - Enh #318: Add menu item "Move content" on wiki view page diff --git a/models/WikiPageRevision.php b/models/WikiPageRevision.php index 8380fdc..d1a002e 100644 --- a/models/WikiPageRevision.php +++ b/models/WikiPageRevision.php @@ -3,6 +3,7 @@ namespace humhub\modules\wiki\models; use humhub\components\ActiveRecord; +use humhub\modules\content\services\ContentSearchService; use humhub\modules\user\models\User; use Yii; @@ -93,7 +94,8 @@ public function afterSave($insert, $changedAttributes) WikiPageRevision::updateAll(['is_latest' => 0], 'wiki_page_id=:wikiPageId AND id!=:selfId', [':wikiPageId' => $this->wiki_page_id, ':selfId' => $this->id]); try { - Yii::$app->search->update(WikiPage::findOne(['id' => $this->wiki_page_id])); + $wikiPage = WikiPage::findOne(['id' => $this->wiki_page_id]); + (new ContentSearchService($wikiPage->content))->update(); } catch (\Throwable $e) { Yii::error($e); } diff --git a/module.json b/module.json index d27e352..2d78389 100644 --- a/module.json +++ b/module.json @@ -3,9 +3,9 @@ "name": "Wiki", "description": "Create and edit pages with this powerful tool. Build a collaborative knowledge base, view and share information with your colleagues.", "keywords": ["wiki"], - "version": "2.1.1", + "version": "2.2.0", "humhub": { - "minVersion": "1.15" + "minVersion": "1.16" }, "homepage": "https://github.com/humhub/wiki", "authors": [