MDL-79511 enrol: Avoid errors on the dynamic properties creation
Currently, Moodle uses fetchOBject() from ADOdb to get the table columns. Sadly, the current ADOdb, especially the fetchObject() function, still creates dynamic properties. Altering the fetchObject() with fetchRow() to avoid the dynamic properties deprecation error on PHP 8.2
This commit is contained in:
@@ -1042,9 +1042,7 @@ class enrol_database_plugin extends enrol_plugin {
|
||||
$rs->Close();
|
||||
|
||||
} else {
|
||||
$fields_obj = $rs->FetchObj();
|
||||
$columns = array_keys((array)$fields_obj);
|
||||
|
||||
$columns = array_keys($rs->fetchRow());
|
||||
echo $OUTPUT->notification('External enrolment table contains following columns:<br />'.implode(', ', $columns), 'notifysuccess');
|
||||
$rs->Close();
|
||||
}
|
||||
@@ -1061,9 +1059,7 @@ class enrol_database_plugin extends enrol_plugin {
|
||||
$rs->Close();
|
||||
|
||||
} else {
|
||||
$fields_obj = $rs->FetchObj();
|
||||
$columns = array_keys((array)$fields_obj);
|
||||
|
||||
$columns = array_keys($rs->fetchRow());
|
||||
echo $OUTPUT->notification('External course table contains following columns:<br />'.implode(', ', $columns), 'notifysuccess');
|
||||
$rs->Close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user