Glossaries in block 'not sticking' (Block)

Glossaries in block 'not sticking' (Block)

by Emma Irwin -
Number of replies: 1
I am able to configure the random glossary block to use a glossary in the same course. However after a while (a day sometimes longer) it disappears and I get the standard '
Please configure this block using the edit icon.'

We recently upgraded to 1.95 , and this has been a problem since this time...why would the block configuration 'go missing' ?

thanks
Average of ratings: -
In reply to Emma Irwin

Re: Glossaries in block 'not sticking' (Block)

by Emma Irwin -
Replying to myself in case someone else comes across this.
I found that the Login-as functionality was responsible for wiping out the glossary settings.

Steps to recreate:

1) Set a glossary block to use a glossary in the course
2) from the list of participants login-as someone else
3) not that the glossary block shows the configuration message (current course is course 1).
4) After clicking 'continue' the glossary block still shows the configuration message.

This are the lines responsible:

if (!isset($modinfo->instances['glossary'][$glossaryid])) {
// we can get here if the glossary has been deleted, so
// unconfigure the glossary from the block..
$this->config->glossary = 0;
//SNIP <>
}

By changing the first line to :
if (!isset($modinfo->instances['glossary'][$glossaryid]) && $COURSE->id != 1 )

I am able to avoid the glossary reset and I am still able to add/delete/change configuration with no bumps.

Does anyone see any issues with this solution>?

Theis change would be in blocks/glossary_random/block_glossary_random.php

MDL-21754