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:
Matt Clarkson
2017-09-13 13:51:30 +02:00
committed by David Monllao
parent 32f9550e85
commit 3043fe924d
+2
View File
@@ -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.
}
}
}