mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-56251 backup: trigger course_section_created/updated events
This commit is contained in:
parent
7aa3925c9a
commit
b0f0200e4f
@ -1593,6 +1593,10 @@ class restore_section_structure_step extends restore_structure_step {
|
||||
}
|
||||
}
|
||||
$newitemid = $DB->insert_record('course_sections', $section);
|
||||
$section->id = $newitemid;
|
||||
|
||||
core\event\course_section_created::create_from_section($section)->trigger();
|
||||
|
||||
$restorefiles = true;
|
||||
|
||||
// Section exists, update non-empty information
|
||||
@ -1612,6 +1616,17 @@ class restore_section_structure_step extends restore_structure_step {
|
||||
|
||||
$DB->update_record('course_sections', $section);
|
||||
$newitemid = $secrec->id;
|
||||
|
||||
// Trigger an event for course section update.
|
||||
$event = \core\event\course_section_updated::create(
|
||||
array(
|
||||
'objectid' => $section->id,
|
||||
'courseid' => $section->course,
|
||||
'context' => context_course::instance($section->course),
|
||||
'other' => array('sectionnum' => $section->section)
|
||||
)
|
||||
);
|
||||
$event->trigger();
|
||||
}
|
||||
|
||||
// Annotate the section mapping, with restorefiles option if needed
|
||||
|
Loading…
x
Reference in New Issue
Block a user