Warning! $course->student(s) and $course->teacher(s) being removed from HEAD very soon

Warning! $course->student(s) and $course->teacher(s) being removed from HEAD very soon

by Tim Hunt -
Number of replies: 1
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
There are four columns teacher, teachers, student, students in the mdl_course table, which were used before Moodle 1.7 to implement renaming roles in particular courses. Since Moodle 1.7 (over 2 years ago!) these have been deprecated - at least in theory.

I have just attached a monster patch to MDL-17083 removing all the references to these 'deprecated' database fields. This is part of the cleaning up we are doing for Moodle 2.0. Here is the diffstat:

 admin/cliupgrade.php | 4 --
 backup/backuplib.php | 4 --
 backup/restorelib.php | 16 ---------
 blocks/quiz_results/block_quiz_results.php | 8 ++--
 course/format/topics/format.php | 5 +-
 course/format/weeks/format.php | 5 +-
 course/pending.php | 7 ----
 enrol/database/enrol.php | 4 --
 enrol/imsenterprise/enrol.php | 11 ------
 enrol/ldap/enrol.php | 4 --
 enrol/manual/enrol.php | 2 -
 enrol/paypal/return.php | 2 -
 lang/en_utf8/glossary.php | 1
 lang/en_utf8/lesson.php | 5 ++
 lang/en_utf8/moodle.php | 5 ++
 lib/adminlib.php | 4 --
 lib/db/install.xml | 10 +----
 lib/db/upgrade.php | 32 +++++++++++++++++++
 lib/weblib.php | 2 -
 mod/assignment/lib.php | 6 +--
 mod/assignment/type/upload/assignment.class.php | 2 -
 mod/glossary/mod_form.php | 2 -
 mod/lesson/essay.php | 10 ++---
 mod/lesson/highscores.php | 2 -
 mod/lesson/locallib.php | 2 -
 mod/lesson/mod_form.php | 4 +-
 mod/lesson/report.php | 4 +-
 mod/lesson/tabs.php | 6 +--
 mod/lesson/view.php | 2 -
 mod/quiz/report/overview/overviewgraph.php | 2 -
 mod/quiz/report/overview/overviewsettings_form.php | 4 +-
 mod/quiz/report/overview/report.php | 2 -
 mod/quiz/report/responses/responsessettings_form.php | 4 +-
 mod/resource/type/file/resource.class.php | 8 ----
 mod/resource/type/repository/resource.class.php | 8 ----
 mod/survey/graph.php | 10 ++++-
 mod/survey/report.php | 6 +--
 mod/wiki/index.php | 4 +-
 user/message.html | 6 ---
 user/messageselect.php | 11 +-----
 version.php | 2 -

If you care about any of the modules/blocks/things mentioned there, I suggest you have a look at my proposed changes ASAP. Some of them are simply cleaning up obsolete references to these fields that do not have any effect. In other places, I have had to change* language strings. Those changes will be visible to users. In almost all cases I don't think the new strings are no worse than the old ones, but there are one or two I am not completely happy with.

I would like to commit this patch quite soon, because keeping a patch this big floating around is a pain. Therefore, I would be very grateful for anyone who is prepared to review any part of it.

You have been warned!


* Well, not change language strings, because you must never do that, it makes life impossible for the translators. I mean change to using different or new language strings to avoid needing to refer to $course->students etc.
Average of ratings: -
In reply to Tim Hunt

Re: Warning! $course->student(s) and $course->teacher(s) being removed from HEAD very soon

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Thanks to Jamie, for commenting on the quiz reports. And Martin, who reviewed the code when I asked him to.

This is now in HEAD.