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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user