installation problem - "This SQL relies on obsolete tables! ...

Re: installation problem - "This SQL relies on obsolete tables! ...

by Murphy Wong -
Number of replies: 0
A better solution is to update the get_course_teachers function in the file located at ~moodle/mod/wiki/db/moodle/wiki_persistor.php (line 833) to the following as instructed by Moodle developers (http://moodle.org/mod/forum/discuss.php?d=86756). The user_teachers table no longer exists in moodle 1.9+ version.



function get_course_teachers($courseid) {
global $CFG;

// updated by Murphy on April 17, 2009 according to
// http://moodle.org/mod/forum/discuss.php?d=86756
$context = get_context_instance(CONTEXT_MODULE, $courseid);
return get_users_by_capability($context, 'mod/module:isteacher', 'u.id,firstname,lastname,picture,email', 'lastname');

/*
return get_records_sql('SELECT u.id, u.firstname, u.lastname
FROM '.$CFG->prefix.'user u, '. $CFG->prefix.'user_teachers ut
WHERE ut.course=\''.$courseid.'\' AND u.id = ut.userid');
*/

}