Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: 1.9.5
-
Fix Version/s: None
-
Component/s: Global search
-
Labels:None
-
Affected Branches:MOODLE_19_STABLE
Description
When $course_id of document equals with '1' (=SITEID), title of the document isn't displayed as results of global search.
Because,
$myCourses = get_my_courses($user->id);
$unenroled = !in_array($course_id, array_keys($myCourses));
the array of get_my_courses() does not include course id '1'.
If glossary is set on each couses, no problem,
on the other hand, if glossary is set on front page as global glossary,
the course ids of contents become to '1'.
function can_display(), search/querylib.php,
private function can_display(&$user, $this_id, $doctype, $course_id, $group_id, $path, $item_type, $context_id, &$searchables) {
global $CFG;
/**
- course related checks
*/
// admins can see everything, anyway.
if (has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))){ return true; }
// first check course compatibility against user : enrolled users to that course can see.
$myCourses = get_my_courses($user->id);
$unenroled = !in_array($course_id, array_keys($myCourses));
// if guests are allowed, logged guest can see
$isallowedguest = (isguest()) ? get_field('course', 'guest', 'id', $course_id) : false ;
if ($unenroled && !$isallowedguest){ // (Debug020): commented out // return false; // (Debug020): add from here if ($course_id != SITEID) return false; // (Debug020): add to here }
Thanks for reporting this issue.
We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.
If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.
Michael d;
lqjjLKA0p6