Skip to content

Commit

Permalink
MDL-40604 course: remove deprecated function
Browse files Browse the repository at this point in the history
* course_delete_module was calling delete_event
* Also fix missing inclusion from 379cd2d
  • Loading branch information
danpoltawski committed Jul 17, 2013
1 parent e52c1ea commit c5ceaea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1404,6 +1404,7 @@ function set_coursemodule_idnumber($id, $idnumber) {
function set_coursemodule_visible($id, $visible) {
global $DB, $CFG;
require_once($CFG->libdir.'/gradelib.php');
require_once($CFG->dirroot.'/calendar/lib.php');

// Trigger developer's attention when using the previously removed argument.
if (func_num_args() > 2) {
Expand Down Expand Up @@ -1470,6 +1471,7 @@ function course_delete_module($cmid) {

require_once($CFG->libdir.'/gradelib.php');
require_once($CFG->dirroot.'/blog/lib.php');
require_once($CFG->dirroot.'/calendar/lib.php');

// Get the course module.
if (!$cm = $DB->get_record('course_modules', array('id' => $cmid))) {
Expand Down Expand Up @@ -1514,7 +1516,8 @@ function course_delete_module($cmid) {
// Delete events from calendar.
if ($events = $DB->get_records('event', array('instance' => $cm->instance, 'modulename' => $modulename))) {
foreach($events as $event) {
delete_event($event->id);
$calendarevent = calendar_event::load($event->id);
$calendarevent->delete();
}
}

Expand Down

0 comments on commit c5ceaea

Please sign in to comment.