MDL-73344 reports: Include the user/report node based on context

Properly indicate the report node based on context.
This commit is contained in:
Peter Dias
2022-03-08 14:02:22 +08:00
parent 0f6643a972
commit c64dc2e545
+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.