mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Merge branch 'MDL-82525-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE
This commit is contained in:
commit
a7f19c9072
@ -1417,11 +1417,11 @@ class core_user {
|
||||
|
||||
// Get courseid from context if provided.
|
||||
if ($context && $coursecontext = $context->get_course_context(false)) {
|
||||
$params['courseid'] = $coursecontext->instanceid;
|
||||
$params['course'] = $coursecontext->instanceid;
|
||||
}
|
||||
|
||||
// If courseid is not set or is set to site id, then return profile page, otherwise return view page.
|
||||
if (!isset($params['courseid']) || $params['courseid'] == SITEID) {
|
||||
if (!isset($params['course']) || $params['course'] == SITEID) {
|
||||
return new moodle_url('/user/profile.php', $params);
|
||||
} else {
|
||||
return new moodle_url('/user/view.php', $params);
|
||||
|
@ -892,7 +892,7 @@ class user_test extends \advanced_testcase {
|
||||
// Display profile url at course context.
|
||||
$course = $this->getDataGenerator()->create_course();
|
||||
$coursecontext = \context_course::instance($course->id);
|
||||
$this->assertEquals("https://www.example.com/moodle/user/view.php?id={$user->id}&courseid={$course->id}",
|
||||
$this->assertEquals("https://www.example.com/moodle/user/view.php?id={$user->id}&course={$course->id}",
|
||||
\core_user::get_profile_url($user, $coursecontext));
|
||||
|
||||
// Throw error if userid is invalid.
|
||||
|
Loading…
x
Reference in New Issue
Block a user