From: skodak Date: Wed, 4 Jun 2008 09:14:17 +0000 (+0000) Subject: MDL-15132 fixed broken sql menu functions - thanks Howard X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ce7fbdb8de1a52b0d89516a844546700ed216879;p=moodle.git MDL-15132 fixed broken sql menu functions - thanks Howard --- diff --git a/lib/dml/moodle_database.php b/lib/dml/moodle_database.php index 82d3b47066..18004c53ab 100644 --- a/lib/dml/moodle_database.php +++ b/lib/dml/moodle_database.php @@ -692,8 +692,9 @@ abstract class moodle_database { $menu = array(); if ($records = $this->get_records_select($table, $select, $params, $sort, $fields, $limitfrom, $limitnum)) { foreach ($records as $record) { - $key = array_unshift($record); - $value = array_unshift($record); + $record = (array)$record; + $key = array_shift($record); + $value = array_shift($record); $menu[$key] = $value; } } @@ -716,8 +717,9 @@ abstract class moodle_database { $menu = array(); if ($records = $this->get_records_sql($sql, $params, $limitfrom, $limitnum)) { foreach ($records as $record) { - $key = array_unshift($record); - $value = array_unshift($record); + $record = (array)$record; + $key = array_shift($record); + $value = array_shift($record); $menu[$key] = $value; } }