mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
Merge branch 'MDL-63303_master-deleteduserfix' of https://github.com/markn86/moodle
This commit is contained in:
commit
9ca803a86d
2 changed files with 9 additions and 2 deletions
|
@ -531,8 +531,12 @@ class helper {
|
||||||
$data->profileimageurlsmall = $userpicture->get_url($PAGE)->out(false);
|
$data->profileimageurlsmall = $userpicture->get_url($PAGE)->out(false);
|
||||||
|
|
||||||
// Set online status indicators.
|
// Set online status indicators.
|
||||||
$data->isonline = self::show_online_status($member) ? self::is_online($member->lastaccess) : null;
|
$data->isonline = false;
|
||||||
$data->showonlinestatus = is_null($data->isonline) ? false : true;
|
$data->showonlinestatus = false;
|
||||||
|
if (!$member->deleted) {
|
||||||
|
$data->isonline = self::show_online_status($member) ? self::is_online($member->lastaccess) : null;
|
||||||
|
$data->showonlinestatus = is_null($data->isonline) ? false : true;
|
||||||
|
}
|
||||||
|
|
||||||
// Set contact and blocked status indicators.
|
// Set contact and blocked status indicators.
|
||||||
$data->iscontact = ($member->contactid) ? true : false;
|
$data->iscontact = ($member->contactid) ? true : false;
|
||||||
|
|
|
@ -1370,6 +1370,9 @@ class core_message_api_testcase extends core_message_messagelib_testcase {
|
||||||
// We should have 5, as $ic1 drops off the list.
|
// We should have 5, as $ic1 drops off the list.
|
||||||
// Group conversations remain albeit with less members.
|
// Group conversations remain albeit with less members.
|
||||||
delete_user($user2);
|
delete_user($user2);
|
||||||
|
// This is to confirm an exception is not thrown when a user AND the user context is deleted.
|
||||||
|
// We no longer delete the user context, but historically we did.
|
||||||
|
context_helper::delete_instance(CONTEXT_USER, $user2->id);
|
||||||
$conversations = \core_message\api::get_conversations($user1->id);
|
$conversations = \core_message\api::get_conversations($user1->id);
|
||||||
$this->assertCount(5, $conversations);
|
$this->assertCount(5, $conversations);
|
||||||
$this->assertEquals($gc3->id, $conversations[0]->id);
|
$this->assertEquals($gc3->id, $conversations[0]->id);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue