-
Bug
-
Resolution: Fixed
-
Critical
-
2.1.5, 2.2.2, 2.3
-
MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
-
MOODLE_21_STABLE, MOODLE_22_STABLE
-
wip-
MDL-31631-m23 -
-
The navigation block caches data about course activities in the user session. This is bad for two reasons:
1. It causes unexpected results if a teacher creates or deletes an activity while students are using the site (for some minutes, the deleted activity link will still be available but give an error).
2. This information is already cached in modinfo.
As modinfo can be obtained free-of-charge in most requests, this means that this part of the cache is unnecessary and is wasting user session space. If the course has hundreds of activities, it might be a moderate proportion of session space.
There are probably other aspects of the navigation block that are not cached in modinfo and therefore it is convenient to cache the whole thing even the bit that is not necessary, but I think somebody should at least consider this; it might be possible to avoid storing the part that comes from modinfo in cache.
Note: I'm not certain all the necessary data about sessions is in modinfo. But if it isn't, it totally ought to be.
The consequences of this bug are not very serious so unfortunately I don't have time to code it at the moment, I guess maybe other people will also not have time, but, thought it was worth filing it after testing staff here reported the problem.