commit ee32ac7e78e23ca44b28ae98e72f54a81031ea7c
Author: Kirill Astashov <kirill.astashov@netspot.com.au>
Date:   Tue May 22 15:20:12 2012 +0930

    UNSW2-235: Fix duplicating activity causing some groups to duplicate

diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php
index 14d130a..f66d557 100644
--- a/backup/moodle2/restore_stepslib.php
+++ b/backup/moodle2/restore_stepslib.php
@@ -729,7 +729,7 @@ class restore_groups_structure_step extends restore_structure_step {
         $params = array('courseid' => $this->get_courseid(), 'grname' => $data->name);
         if (!empty($data->description)) {
             $description_clause = ' AND ' .
-                                  $DB->sql_compare_text('description') . ' = ' . $DB->sql_compare_text(':description');
+                                  'replace(' . $DB->sql_compare_text('description') . ", '\r\n', '\n') = " . $DB->sql_compare_text(':description');
            $params['description'] = $data->description;
         }
         if (!$groupdb = $DB->get_record_sql("SELECT *
