MDL-62713 core_search: Cron error indexing sections in some cases

This commit is contained in:
sam marshall
2018-06-29 10:52:53 +01:00
parent 543005a342
commit c843630aee
+3
View File
@@ -85,6 +85,9 @@ class section extends \core_search\base {
* @return \core_search\document
*/
public function get_document($record, $options = array()) {
global $CFG;
require_once($CFG->dirroot . '/course/lib.php');
// Get the context, modinfo, and section.
try {
$context = \context_course::instance($record->course);