It appears this is due to the block storing the source glossary id in its (base64-encoded) config column. The restore process doesn't know anything about this, and so cannot remap the old id to a new one.
Now, the restore process calls (if it exists) $block->after_restore(), so I tried to put a fix in there. However, at the time after_restore() is called, the restore process has not yet updated the course_module.instance field, so the block will only get '0' as the relevant glossary id.
So, I'm currently a little stuck. One solution would be to move the after_restore call to the end of the restore process, which means saving a list of restored blocks then iterating through those.
Any feedback or suggestions are welcomed; I'm keen to fix this as soon as I can.
Cheers,
It appears this is due to the block storing the source glossary id in its (base64-encoded) config column. The restore process doesn't know anything about this, and so cannot remap the old id to a new one.
Now, the restore process calls (if it exists) $block->after_restore(), so I tried to put a fix in there. However, at the time after_restore() is called, the restore process has not yet updated the course_module.instance field, so the block will only get '0' as the relevant glossary id.
So, I'm currently a little stuck. One solution would be to move the after_restore call to the end of the restore process, which means saving a list of restored blocks then iterating through those.
Any feedback or suggestions are welcomed; I'm keen to fix this as soon as I can.
Cheers,