mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-78927 core_user: Profile page missing breadcrumbs if no id=
This commit is contained in:
parent
6f40d9ffd7
commit
3be5a98a8d
1 changed files with 5 additions and 2 deletions
|
@ -42,8 +42,6 @@ $userid = optional_param('id', 0, PARAM_INT);
|
||||||
$edit = optional_param('edit', null, PARAM_BOOL); // Turn editing on and off.
|
$edit = optional_param('edit', null, PARAM_BOOL); // Turn editing on and off.
|
||||||
$reset = optional_param('reset', null, PARAM_BOOL);
|
$reset = optional_param('reset', null, PARAM_BOOL);
|
||||||
|
|
||||||
$PAGE->set_url('/user/profile.php', array('id' => $userid));
|
|
||||||
|
|
||||||
if (!empty($CFG->forceloginforprofiles)) {
|
if (!empty($CFG->forceloginforprofiles)) {
|
||||||
require_login();
|
require_login();
|
||||||
if (isguestuser()) {
|
if (isguestuser()) {
|
||||||
|
@ -60,6 +58,11 @@ if (!empty($CFG->forceloginforprofiles)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$userid = $userid ? $userid : $USER->id; // Owner of the page.
|
$userid = $userid ? $userid : $USER->id; // Owner of the page.
|
||||||
|
|
||||||
|
// Even if the user didn't supply a userid, we treat page URL as if they did; this is needed
|
||||||
|
// so navigation works correctly.
|
||||||
|
$PAGE->set_url('/user/profile.php', ['id' => $userid]);
|
||||||
|
|
||||||
if ((!$user = $DB->get_record('user', array('id' => $userid))) || ($user->deleted)) {
|
if ((!$user = $DB->get_record('user', array('id' => $userid))) || ($user->deleted)) {
|
||||||
$PAGE->set_context(context_system::instance());
|
$PAGE->set_context(context_system::instance());
|
||||||
echo $OUTPUT->header();
|
echo $OUTPUT->header();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue