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:
+3
-3
@@ -608,7 +608,7 @@ class flexible_table {
|
||||
if (isset($this->columns[$column])) {
|
||||
continue; // This column is OK.
|
||||
}
|
||||
if (in_array($column, get_all_user_name_fields()) &&
|
||||
if (in_array($column, \core\user_fields::get_name_fields()) &&
|
||||
isset($this->columns['fullname'])) {
|
||||
continue; // This column is OK.
|
||||
}
|
||||
@@ -1235,7 +1235,7 @@ class flexible_table {
|
||||
$nameformat = get_string('fullnamedisplay');
|
||||
}
|
||||
|
||||
$requirednames = order_in_string(get_all_user_name_fields(), $nameformat);
|
||||
$requirednames = order_in_string(\core\user_fields::get_name_fields(), $nameformat);
|
||||
|
||||
if (!empty($requirednames)) {
|
||||
if ($this->is_sortable($column)) {
|
||||
@@ -1315,7 +1315,7 @@ class flexible_table {
|
||||
$sortdata = array_merge([$sortby => $sortorder], $sortdata);
|
||||
}
|
||||
|
||||
$usernamefields = get_all_user_name_fields();
|
||||
$usernamefields = \core\user_fields::get_name_fields();
|
||||
$sortdata = array_filter($sortdata, function($sortby) use ($usernamefields) {
|
||||
$isvalidsort = $sortby && $this->is_sortable($sortby);
|
||||
$isvalidsort = $isvalidsort && empty($this->prefs['collapse'][$sortby]);
|
||||
|
||||
Reference in New Issue
Block a user