mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
global search MDL-24892 fix in wiki search document to use subwikis.
This commit is contained in:
parent
33bd52f3e9
commit
c79fd8a91e
@ -220,11 +220,14 @@ function wiki_single_document($id, $itemtype) {
|
||||
global $DB;
|
||||
|
||||
$page = $DB->get_record('wiki_pages', array('id' => $id));
|
||||
$entry = $DB->get_record('wiki_entries', array('id' => $page->subwikiid));
|
||||
$entry = $DB->get_record('wiki_subwikis', array('id' => $page->subwikiid));
|
||||
$wiki = $DB->get_record('wiki', array('id' => $entry->wikiid));
|
||||
$coursemodule = $DB->get_field('modules', 'id', array('name' => 'wiki'));
|
||||
$cm = $DB->get_record('course_modules', array('course' => $entry->course, 'module' => $coursemodule, 'instance' => $entry->wikiid));
|
||||
$cm = $DB->get_record('course_modules', array('course' => $wiki->course, 'module' => $coursemodule, 'instance' => $entry->wikiid));
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
return new WikiSearchDocument(get_object_vars($page), $entry->wikiid, $entry->course, $entry->groupid, $page->userid, $context->id);
|
||||
$user = $DB->get_record('user', array('id' => $page->userid));
|
||||
$page->author = fullname($user);
|
||||
return new WikiSearchDocument(get_object_vars($page), $entry->wikiid, $wiki->course, $entry->groupid, $page->userid, $context->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user