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:
Meirza
2023-09-27 16:42:50 +07:00
parent c6e727732a
commit a72d935dbc
+2 -6
View File
@@ -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();
}