glossary->id for block is now properly recoded by restore. MDL-4934

This commit is contained in:
stronk7
2008-04-27 01:53:25 +00:00
parent 28580a7575
commit 3b384c750f
@@ -208,5 +208,17 @@ class block_glossary_random extends block_base {
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();
}
}
}
?>