-
Bug
-
Resolution: Fixed
-
Major
-
2.6, 3.0.5, 3.1.1, 3.1.5, 3.2.2
-
MOODLE_26_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
-
MOODLE_31_STABLE, MOODLE_32_STABLE
-
wip-
MDL-41809-master -
Rewriting the issue description after investigation:
grade_item->get_name() in conditionlib returns the name that has already been formatted and passed through get_string(). The item name is cached in course modinfo/sectioninfo if there is some module or section with availability depending on the grade in this item.
This was discovered via the debugging message if format_string() is called before page context was set (see below), but it also means that get_string and format_string are called for language, user and context that were used when cache was build and not when the string was displayed. This may cause problems in multilang environment and comprehensive filters that depend on particular course.
Example: with multilang filter enabled, cache was rebuild when english-speaking teacher was accessing the course. The English name of the activity will be displayed to French-speaking student.
---------------
Original description:
It seems that something has been recently broken:
1) master branch (I've not tried stables)
2) Go to ANY activity (DEBUG_DEVELOPER enabled). I've tried glossary, forum, lesson.
3) Purge caches
4) After the redirect, this is shown:
Coding problem: $PAGE->context was not set. You may have forgotten to call require_login() or $PAGE->set_context(). The page may not display correctly as a result
|
line 451 of /lib/pagelib.php: call to debugging()
|
line 734 of /lib/pagelib.php: call to moodle_page->magic_get_context()
|
line 1342 of /lib/weblib.php: call to moodle_page->__get()
|
line 1223 of /lib/grade/grade_item.php: call to format_string()
|
line 575 of /lib/conditionlib.php: call to grade_item->get_name()
|
line 525 of /lib/conditionlib.php: call to condition_info_base::get_grade_name()
|
line 131 of /lib/conditionlib.php: call to condition_info_base::fill_availability_conditions_inner()
|
line 1064 of /course/lib.php: call to condition_info::fill_availability_conditions()
|
line 617 of /lib/modinfolib.php: call to get_array_of_activities()
|
line 450 of /lib/modinfolib.php: call to course_modinfo::build_course_cache()
|
line 411 of /lib/modinfolib.php: call to course_modinfo->__construct()
|
line 2003 of /lib/modinfolib.php: call to course_modinfo::instance()
|
line 2837 of /lib/moodlelib.php: call to get_fast_modinfo()
|
line 42 of /mod/lesson/view.php: call to require_login()
|
Weird, because it is require_login() the function being executed.
Ciao
- has a non-specific relationship to
-
MDL-58407 Avoid caching language strings and formatted strings in modinfo
- Closed
- has been marked as being related by
-
MDL-49418 Teacher error on resources/activities with 2+ activity completion in restrict access
- Closed
-
MDL-48630 wrong image url in textfields when using mutliple domains
- Closed
- is a regression caused by
-
MDL-10557 Activity names in gradebook don't support multilang filter
- Closed
- is duplicated by
-
MDL-55217 $PAGE->context was not set errors related to availability_grade
- Closed
-
MDL-57871 Unable to move content with course section with grade access restriction when debug messages enabled
- Closed
-
MDL-58675 Error when I launch pdf editor at an assignment with access restriction
- Closed
- will be (partly) resolved by
-
MDL-45584 Can't instantiate multiple caches of same definition with different identifiers
- Closed