ARGGG. I spent 1 hour discovering where was the error!!

Under PHP5 we must cast objects to arrays to use them in loops.
But what is really annoying is that, instead of return an error, PHP
returns the 1st element! This should close bug 2581.
(http://moodle.org/bugs/bug.php?op=show&bugid=2581)

Merged from HEAD
This commit is contained in:
stronk7
2005-02-18 00:23:01 +00:00
parent b88317c2e7
commit eea96a893f
+2 -2
View File
@@ -20,7 +20,7 @@
if ($data = data_submitted("$CFG->wwwroot/mod/glossary/view.php")) { // form submitted
foreach ($data as $entry => $rating) {
foreach ((array)$data as $entry => $rating) {
if ($entry == "id") {
continue;
}
@@ -32,7 +32,7 @@
error("Could not update an old rating ($entry = $rating)");
}
}
} else if ($rating) {
} else if ($rating >= 0) {
unset($newrating);
$newrating->userid = $USER->id;
$newrating->time = time();