From e9dcdce2c870c584a3f430947b694694b0b9976e Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Tue, 10 Oct 2023 17:10:15 +0200 Subject: [PATCH] search: incr search for wiki/exercise, i --- .../Exercise/Assignment/class.ilExAssignment.php | 4 ++-- Modules/Wiki/classes/class.ilWikiPage.php | 1 + Services/Search/classes/class.ilObjectSearch.php | 13 ++++++++++++- Services/Search/service.xml | 4 +++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Modules/Exercise/Assignment/class.ilExAssignment.php b/Modules/Exercise/Assignment/class.ilExAssignment.php index 3bcf405f64c6..4aafb455576a 100644 --- a/Modules/Exercise/Assignment/class.ilExAssignment.php +++ b/Modules/Exercise/Assignment/class.ilExAssignment.php @@ -782,7 +782,7 @@ public function save(): void $exc = new ilObjExercise($this->getExerciseId(), false); $exc->updateAllUsersStatus(); self::createNewAssignmentRecords($next_id, $exc); - + ilObjectSearch::raiseContentChanged($this->getExerciseId()); $this->handleCalendarEntries("create"); } @@ -836,7 +836,7 @@ public function update(): void ); $exc = new ilObjExercise($this->getExerciseId(), false); $exc->updateAllUsersStatus(); - + ilObjectSearch::raiseContentChanged($this->getExerciseId()); $this->handleCalendarEntries("update"); } diff --git a/Modules/Wiki/classes/class.ilWikiPage.php b/Modules/Wiki/classes/class.ilWikiPage.php index e904a2f68503..c7877ee1d45f 100755 --- a/Modules/Wiki/classes/class.ilWikiPage.php +++ b/Modules/Wiki/classes/class.ilWikiPage.php @@ -217,6 +217,7 @@ public function update( ilWikiUtil::sendNotification("update", ilNotification::TYPE_WIKI_PAGE, $this->getWikiRefId(), $this->getId()); $this->log->debug("update news"); + ilObjectSearch::raiseContentChanged($this->getWikiId()); $this->updateNews(true); } else { return $updated; diff --git a/Services/Search/classes/class.ilObjectSearch.php b/Services/Search/classes/class.ilObjectSearch.php index 03aa59d77787..b14e8668d4ca 100644 --- a/Services/Search/classes/class.ilObjectSearch.php +++ b/Services/Search/classes/class.ilObjectSearch.php @@ -51,7 +51,18 @@ public function __construct(ilQueryParser $qp_obj) } - + public static function raiseContentChanged(int $obj_id) : void + { + global $DIC; + + $DIC->event()->raise( + 'Services/Search', + 'contentChanged', + [ + "obj_id" => $obj_id + ] + ); + } public function performSearch(): ilSearchResult { diff --git a/Services/Search/service.xml b/Services/Search/service.xml index 834aca0e09a1..3b55f84351b7 100644 --- a/Services/Search/service.xml +++ b/Services/Search/service.xml @@ -9,7 +9,9 @@ adm - + + +