Adding one more require_once($CFG->dirroot . '/course/lib.php') to another rebuild_course_cache()
Adding one more require_once($CFG->dirroot . '/course/lib.php') to another rebuild_course_cache()

dilawar/moodle