MDL-45242 Lib: Replace calls to deprecated functions

In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
This commit is contained in:
sam marshall
2021-03-10 10:57:10 +00:00
parent 3f003455f3
commit 558cc1b85e
152 changed files with 612 additions and 394 deletions
+5 -3
View File
@@ -224,7 +224,7 @@ class workshop_manual_allocator implements workshop_allocator {
// load the participants' submissions
$submissions = $this->workshop->get_submissions(array_keys($participants));
$allnames = get_all_user_name_fields();
$allnames = \core\user_fields::get_name_fields();
foreach ($submissions as $submission) {
if (!isset($userinfo[$submission->authorid])) {
$userinfo[$submission->authorid] = new stdclass();
@@ -243,7 +243,8 @@ class workshop_manual_allocator implements workshop_allocator {
$reviewers = array();
if ($submissions) {
list($submissionids, $params) = $DB->get_in_or_equal(array_keys($submissions), SQL_PARAMS_NAMED);
$picturefields = user_picture::fields('r', array(), 'reviewerid');
$userfieldsapi = \core\user_fields::for_userpic();
$picturefields = $userfieldsapi->get_sql('r', false, '', 'reviewerid', false)->selects;
$sql = "SELECT a.id AS assessmentid, a.submissionid, $picturefields,
s.id AS submissionid, s.authorid
FROM {workshop_assessments} a
@@ -269,7 +270,8 @@ class workshop_manual_allocator implements workshop_allocator {
$reviewees = array();
if ($participants) {
list($participantids, $params) = $DB->get_in_or_equal(array_keys($participants), SQL_PARAMS_NAMED);
$namefields = get_all_user_name_fields(true, 'e');
$userfieldsapi = \core\user_fields::for_name();
$namefields = $userfieldsapi->get_sql('e', false, '', '', false)->selects;
$params['workshopid'] = $this->workshop->id;
$sql = "SELECT a.id AS assessmentid, a.submissionid,
u.id AS reviewerid,