Merge branch 'wip-MDL-31179-master' of github.com:marinaglancy/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 23 Jan 2012 00:19:18 +0000 (01:19 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 23 Jan 2012 00:19:18 +0000 (01:19 +0100)
lib/moodlelib.php
lib/simpletest/testcompletionlib.php
lib/simpletest/testfilterconfig.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 c78063b..1496494 100644 (file)
@@ -46,11 +46,11 @@ class fake_recordset implements Iterator {
     }
 
     function close() {
-        $closed=true;
+        $this->closed=true;
     }
 
     function was_closed() {
-        return $closed;
+        return $this->closed;
     }
 }
 
index 28ad2df..379fc11 100644 (file)
@@ -785,6 +785,7 @@ class filter_filter_set_applies_to_strings extends UnitTestCaseUsingDatabase {
     }
 
     public function tearDown() {
+        global $CFG;
         $CFG->stringfilters = $this->origcfgstringfilters;
         $CFG->filterall = $this->origcfgfilterall;
 
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'));