From 5dd79c77810811eb9d8feebaf2031f512c1504c0 Mon Sep 17 00:00:00 2001 From: Meirza Date: Wed, 27 Sep 2023 16:43:15 +0700 Subject: [PATCH] MDL-79511 auth: 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 --- auth/db/auth.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/auth/db/auth.php b/auth/db/auth.php index 3a4d9696104..26fa1cc424f 100644 --- a/auth/db/auth.php +++ b/auth/db/auth.php @@ -760,9 +760,7 @@ class auth_plugin_db extends auth_plugin_base { $rs->close(); } else { - $fields_obj = $rs->FetchObj(); - $columns = array_keys((array)$fields_obj); - + $columns = array_keys($rs->fetchRow()); echo $OUTPUT->notification(get_string('auth_dbcolumnlist', 'auth_db', implode(', ', $columns)), 'notifysuccess'); $rs->close(); }