-
Bug
-
Resolution: Fixed
-
Major
-
2.6.5, 2.7.2
-
MOODLE_26_STABLE, MOODLE_27_STABLE
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
MDL-48036-master -
We have category names as multilang strings in 3 different languages.
We noticed that when requesting a new course through course/request.php, the language of the course category names stay the same even when a different language is selected.
We found that the category list is actually generated once according to UI language setting at that point in time and then cached for 10 minutes.
course/request_form.php on line 73 calls coursecat::make_categories_list in lib/coursecatlib.php
$displaylist = coursecat::make_categories_list();
|
http://git.moodle.org/gw?p=moodle.git;a=blob;f=course/request_form.php;hb=refs/heads/master#l73
The bug seems to lie in the way make_categories_list() handles the caching. The multilang filtering is done before caching the category list.
'name' => format_string($record->name, true, array('context' => $context)),
|
http://git.moodle.org/gw?p=moodle.git;a=blob;f=lib/coursecatlib.php;hb=refs/heads/master#l2183
This makes displaying the list of categories in other languages impossible until the cache is emptied after 10 minutes.
A possible workaround is disable caching by setting $baselist=false in make_categories_list(). Is this kind of caching necessary for performance reasons? If so, could caching be done so that the entire multilang string is cached and format_string applied later on in course/request.php - and everywhere else a call to make_categories_list() is made?
- has a non-specific relationship to
-
MDL-38147 Create class coursecat for managing and displaying course categories
-
- Closed
-