Merge branch 'w04_MDL-31181_m23_fitlertestcfg' of git://github.com/skodak/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 23 Jan 2012 00:04:00 +0000 (01:04 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 23 Jan 2012 00:04:00 +0000 (01:04 +0100)
lib/moodlelib.php
mod/forum/lib.php
question/type/match/backup/moodle1/lib.php

index 5582758..ae5e137 100644 (file)
@@ -2218,7 +2218,7 @@ function get_timezone_record($timezonename) {
     }
 
     return $cache[$timezonename] = $DB->get_record_sql('SELECT * FROM {timezone}
-                                                        WHERE name = ? ORDER BY year DESC', array($timezonename), true);
+                                                        WHERE name = ? ORDER BY year DESC', array($timezonename), IGNORE_MULTIPLE);
 }
 
 /**
index b32e281..2df0ad2 100644 (file)
@@ -7897,7 +7897,7 @@ function forum_get_forums_user_posted_in($user, array $courseids = null, $discus
  *               ->posts: An array containing the posts to show for this request.
  */
 function forum_get_posts_by_user($user, array $courses, $musthaveaccess = false, $discussionsonly = false, $limitfrom = 0, $limitnum = 50) {
-    global $DB, $USER;
+    global $DB, $USER, $CFG;
 
     $return = new stdClass;
     $return->totalcount = 0;    // The total number of posts that the current user is able to view
index 08afe9a..94ba827 100644 (file)
@@ -56,7 +56,11 @@ class moodle1_qtype_match_handler extends moodle1_qtype_handler {
         }
 
         // convert match options
-        $matchoptions = $data['matchoptions'][0];
+        if (isset($data['matchoptions'])) {
+            $matchoptions = $data['matchoptions'][0];
+        } else {
+            $matchoptions = array('shuffleanswers' => 1);
+        }
         $matchoptions['id'] = $this->converter->get_nextid();
         $matchoptions['subquestions'] = implode(',', $matchids);
         $this->write_xml('matchoptions', $matchoptions, array('/matchoptions/id'));