mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-83143 core_course: Add course name as default for empty room name
This commit is contained in:
parent
a6d857d9e5
commit
e0cce75501
@ -4801,6 +4801,12 @@ function course_get_communication_instance_data(int $courseid): array {
|
||||
*/
|
||||
function course_update_communication_instance_data(stdClass $data): void {
|
||||
$data->id = $data->instanceid; // For correct use in update_course.
|
||||
// If the room name is set to empty, then set it course name.
|
||||
$provider = $data->selectedcommunication ?? null;
|
||||
$roomnameidentifier = $provider . 'roomname';
|
||||
if ($provider && empty($data->$roomnameidentifier)) {
|
||||
$data->$roomnameidentifier = $data->fullname ?? get_course($data->id)->fullname;
|
||||
}
|
||||
core_communication\helper::update_course_communication_instance(
|
||||
course: $data,
|
||||
changesincoursecat: false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user