Merge branch 'MDL-55565-master' of https://github.com/snake/moodle
authorDan Poltawski <dan@moodle.com>
Mon, 22 Aug 2016 13:22:38 +0000 (14:22 +0100)
committerDan Poltawski <dan@moodle.com>
Mon, 22 Aug 2016 13:22:38 +0000 (14:22 +0100)
backup/util/dbops/restore_dbops.class.php

index 6d48d36..a4c7075 100644 (file)
@@ -795,7 +795,7 @@ abstract class restore_dbops {
                      // Prepare the query
                      list($stamp_sql, $stamp_params) = $DB->get_in_or_equal($stamps);
                      list($context_sql, $context_params) = $DB->get_in_or_equal($contexts);
-                     $sql = "SELECT contextid
+                     $sql = "SELECT DISTINCT contextid
                                FROM {question_categories}
                               WHERE stamp $stamp_sql
                                 AND contextid $context_sql";