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
+3 -3
View File
@@ -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]);