Merge branch 'MDL-73344-311' of https://github.com/peterRd/moodle into MOODLE_311_STABLE

This commit is contained in:
Ilya Tregubov
2022-03-16 10:05:20 +06:00
+3 -1
View File
@@ -2031,7 +2031,9 @@ class moodle_page {
$reportnode = null;
$navigationnodeerror =
'Could not find the navigation node requested. Please check that the node you are looking for exists.';
if ($userid != $USER->id) {
if ($userid != $USER->id || $this->context->contextlevel == CONTEXT_COURSE) {
// Within a course context we need to properly indicate how we have come to the page,
// regardless of whether it's currently logged in user or not.
// Check that we have a valid node.
if (empty($newusernode)) {
// Throw an error if we ever reach here.