MDL-60105 search: Fix fatal error
If an indexed file has been modified or deleted the search index will still reference the old file. Remove the file from search results until the change has been indexed.
This commit is contained in:
committed by
David Monllao
parent
32f9550e85
commit
3043fe924d
@@ -231,6 +231,8 @@ class document implements \renderable, \templatable {
|
||||
|
||||
if ($file = $fs->get_file_by_id($id)) {
|
||||
$this->files[$id] = $file;
|
||||
} else {
|
||||
unset($this->files[$id]); // Index is out of date and referencing a file that does not exist.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user