-
Bug
-
Resolution: Fixed
-
Blocker
-
2.7.5, 2.8.4
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
-
wip-
MDL-49418-master -
If a teacher create a resource/activity and add 2+ restrict access -> activity completion the teacher will see an error
For admins or students everything works fine
How to replicate this problem on a fresh moodle 2.7.5+ (Build: 20150305):
1. enable "Enable conditional access" underr Site administration -> Advanced features
2. enable "Enable completion tracking" under Site administration -> Advanced features
3. create a course and enrol students/teachers (enable completion tracking)
4. login as the teacher account
5. upload file1 and file2
6. add a new file and in restrict access add activity completion on file1
7. save and display -> everything works
8. edit file and in restrict access add activity completion on file2
9. save and display -> error
This is the error:
Coding error detected, it must be fixed by a programmer: The theme has already been set up for this page ready for output. Therefore, you can no longer change the theme, or anything that might affect what the current theme is, for example, the course.
Debug info: Stack trace when the theme was set up: <ul style="text-align: left" data-rel="backtrace"><li>line 637 of /lib/pagelib.php: call to moodle_page->initialise_theme_and_output()</li><li>line 812 of /lib/pagelib.php: call to moodle_page->magic_get_theme()</li><li>line 507 of /availability/classes/tree.php: call to moodle_page->get_renderer()</li><li>line 416 of /availability/classes/tree.php: call to core_availability\tree->get_full_information_recursive()</li><li>line 216 of /availability/classes/info.php: call to core_availability\tree->get_result_information()</li><li>line 1780 of /lib/modinfolib.php: call to core_availability\info->is_available()</li><li>line 1807 of /lib/modinfolib.php: call to cm_info->obtain_dynamic_data()</li><li>line 1176 of /lib/modinfolib.php: call to cm_info->get_user_visible()</li><li>line 3144 of /lib/moodlelib.php: call to cm_info->__get()</li><li>line 3292 of /lib/moodlelib.php: call to require_login()</li><li>line 51 of /mod/resource/view.php: call to require_course_login()</li></ul>
Error code: codingerror
Stack trace:
line 1832 of /lib/pagelib.php: coding_exception thrown
line 914 of /lib/pagelib.php: call to moodle_page->ensure_theme_not_set()
line 1002 of /lib/pagelib.php: call to moodle_page->set_course()
line 3158 of /lib/moodlelib.php: call to moodle_page->set_cm()
line 3292 of /lib/moodlelib.php: call to require_login()
line 51 of /mod/resource/view.php: call to require_course_login()
Output buffer: <div class="notifytiny debuggingmessage" data-rel="debugging">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<ul style="text-align: left" data-rel="backtrace"><li>line 453 of /lib/pagelib.php: call to debugging()</li><li>line 1502 of /lib/pagelib.php: call to moodle_page->magic_get_context()</li><li>line 637 of /lib/pagelib.php: call to moodle_page->initialise_theme_and_output()</li><li>line 812 of /lib/pagelib.php: call to moodle_page->magic_get_theme()</li><li>line 507 of /availability/classes/tree.php: call to moodle_page->get_renderer()</li><li>line 416 of /availability/classes/tree.php: call to core_availability\tree->get_full_information_recursive()</li><li>line 216 of /availability/classes/info.php: call to core_availability\tree->get_result_information()</li><li>line 1780 of /lib/modinfolib.php: call to core_availability\info->is_available()</li><li>line 1807 of /lib/modinfolib.php: call to cm_info->obtain_dynamic_data()</li><li>line 1176 of /lib/modinfolib.php: call to cm_info->get_user_visible()</li><li>line 3144 of /lib/moodlelib.php: call to cm_info->__get()</li><li>line 3292 of /lib/moodlelib.php: call to require_login()</li><li>line 51 of /mod/resource/view.php: call to require_course_login()</li></ul></div>
- has a non-specific relationship to
-
MDL-41809 Call to format_text during course cache building causes debugging message
-
- Closed
-
-
MDL-49451 Add behat test covering MDL-49418 (and ideally other require_login implications)
-
- Open
-
- has been marked as being related by
-
MDL-49434 Availability code uses the renderer as part of $cm->uservisible check
-
- Closed
-
- Testing discovered
-
MDL-49434 Availability code uses the renderer as part of $cm->uservisible check
-
- Closed
-