Index: block_glossary_random.php
===================================================================
RCS file: /cvsroot/moodle/moodle/blocks/glossary_random/block_glossary_random.php,v
retrieving revision 1.20.6.5
diff -u -r1.20.6.5 block_glossary_random.php
--- block_glossary_random.php	3 Mar 2008 11:41:02 -0000	1.20.6.5
+++ block_glossary_random.php	23 Apr 2008 01:30:20 -0000
@@ -226,5 +226,17 @@
         return false;
     }
 
+    /**
+     * Executed after block instance has been created, we use it to recode
+     * the glossary config setting to point to the new (restored) one
+     */
+    function after_restore($restore) {
+    /// We need to transform the glossary->id from the original one to the restored one
+        if ($rec = backup_getid($restore->backup_unique_code, 'glossary', $this->config->glossary)) {
+            $this->config->glossary = $rec->new_id;
+            $this->instance_config_commit();
+        }
+    }
+
 }
 ?>

