Hi all,
I am using Moodle 3.3.1. Today I found a new notice on the top page of one of my courses:
Notice: Trying to get property of non-object in /home/jboyle/public_html/moodle/lib/completionlib.php on line 255
The code in completionlib.php is line 255 identified:
/**
* Constructs with course details.
*
* When instantiating a new completion info object you must provide a course
* object with at least id, and enablecompletion properties. Property
* cacherev is needed if you check completion of the current user since
* it is used for cache validation.
*
* @param stdClass $course Moodle course object.
*/
public function __construct($course) {
$this->course = $course;
$this->course_id = $course->id; (this is line 255)
}
/**
* Determines whether completion is enabled across entire site.
*
* @return bool COMPLETION_ENABLED (true) if completion is enabled for the site,
* COMPLETION_DISABLED (false) if it's complete
*/
public static function is_enabled_for_site() {
global $CFG;
return !empty($CFG->enablecompletion);
}
Does anyone know how to remove this notice message? What damage can it do?
Best
Joe Boyle