From 4c8dc6a95ef711d180e6e9eb9c903b883bbd9759 Mon Sep 17 00:00:00 2001 From: Eric Merrill Date: Thu, 4 Dec 2025 23:56:17 -0500 Subject: [PATCH] MDL-87406 customfield: Use recordset for processing upgrade --- public/lib/db/upgrade.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/lib/db/upgrade.php b/public/lib/db/upgrade.php index 8a290af2fa7..bfef7f10e85 100644 --- a/public/lib/db/upgrade.php +++ b/public/lib/db/upgrade.php @@ -1490,7 +1490,7 @@ function xmldb_main_upgrade($oldversion) { FROM {customfield_data} d JOIN {customfield_field} f ON d.fieldid = f.id JOIN {customfield_category} c ON f.categoryid = c.id"; - $records = $DB->get_records_sql($sql); + $records = $DB->get_recordset_sql($sql); foreach ($records as $r) { $DB->update_record('customfield_data', (object)[ @@ -1501,6 +1501,8 @@ function xmldb_main_upgrade($oldversion) { ]); } + $records->close(); + // Define table customfield_shared to be created. $table = new xmldb_table('customfield_shared');