Skip to content

Commit

Permalink
search: incr search for wiki/exercise, i
Browse files Browse the repository at this point in the history
  • Loading branch information
alex40724 committed Oct 10, 2023
1 parent f00d262 commit e9dcdce
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Modules/Exercise/Assignment/class.ilExAssignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down Expand Up @@ -836,7 +836,7 @@ public function update(): void
);
$exc = new ilObjExercise($this->getExerciseId(), false);
$exc->updateAllUsersStatus();

ilObjectSearch::raiseContentChanged($this->getExerciseId());
$this->handleCalendarEntries("update");
}

Expand Down
1 change: 1 addition & 0 deletions Modules/Wiki/classes/class.ilWikiPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 12 additions & 1 deletion Services/Search/classes/class.ilObjectSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 3 additions & 1 deletion Services/Search/service.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
<parent id="adm" max="1">adm</parent>
</object>
</objects>
<events>
<events>
<event type="raise" id="contentChanged" />
<event type="listen" id="Services/Search" />
<event type="listen" id="Services/Object" />
</events>
<crons>
Expand Down

0 comments on commit e9dcdce

Please sign in to comment.