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:
@@ -150,7 +150,8 @@ abstract class engine {
|
||||
global $DB;
|
||||
|
||||
if (empty(self::$cachedusers[$userid])) {
|
||||
$fields = get_all_user_name_fields(true);
|
||||
$userfieldsapi = \core\user_fields::for_name();
|
||||
$fields = $userfieldsapi->get_sql('', false, '', '', false)->selects;
|
||||
self::$cachedusers[$userid] = $DB->get_record('user', array('id' => $userid), 'id, ' . $fields);
|
||||
}
|
||||
return self::$cachedusers[$userid];
|
||||
|
||||
Reference in New Issue
Block a user