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:
+4
-6
@@ -294,9 +294,8 @@
|
||||
echo $OUTPUT->notification(get_string('recorddeleted','data'), 'notifysuccess');
|
||||
}
|
||||
} else { // Print a confirmation page
|
||||
$allnamefields = user_picture::fields('u');
|
||||
// Remove the id from the string. This already exists in the sql statement.
|
||||
$allnamefields = str_replace('u.id,', '', $allnamefields);
|
||||
$userfieldsapi = \core\user_fields::for_userpic()->excluding('id');
|
||||
$allnamefields = $userfieldsapi->get_sql('u', false, '', '', false)->selects;
|
||||
$dbparams = array($delete);
|
||||
if ($deleterecord = $DB->get_record_sql("SELECT dr.*, $allnamefields
|
||||
FROM {data_records} dr
|
||||
@@ -332,9 +331,8 @@
|
||||
$validrecords = array();
|
||||
$recordids = array();
|
||||
foreach ($multidelete as $value) {
|
||||
$allnamefields = user_picture::fields('u');
|
||||
// Remove the id from the string. This already exists in the sql statement.
|
||||
$allnamefields = str_replace('u.id,', '', $allnamefields);
|
||||
$userfieldsapi = \core\user_fields::for_userpic()->excluding('id');
|
||||
$allnamefields = $userfieldsapi->get_sql('u', false, '', '', false)->selects;
|
||||
$dbparams = array('id' => $value);
|
||||
if ($deleterecord = $DB->get_record_sql("SELECT dr.*, $allnamefields
|
||||
FROM {data_records} dr
|
||||
|
||||
Reference in New Issue
Block a user