MDL-40604 Fix 2 uses causing unit test failures
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 17 Jul 2013 00:34:07 +0000 (02:34 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 17 Jul 2013 00:34:07 +0000 (02:34 +0200)
There are still a lot of deprecated uses in core
that we should move to the new counterparts ASAP.

This commit just fixes the 2 deprecated uses that
are causing unit tests to fail.

course/lib.php

index 28cc82a..0efc8db 100644 (file)
@@ -1427,9 +1427,11 @@ function set_coursemodule_visible($id, $visible) {
     if ($events = $DB->get_records('event', array('instance'=>$cm->instance, 'modulename'=>$modulename))) {
         foreach($events as $event) {
             if ($visible) {
     if ($events = $DB->get_records('event', array('instance'=>$cm->instance, 'modulename'=>$modulename))) {
         foreach($events as $event) {
             if ($visible) {
-                show_event($event);
+                $event = new calendar_event($event);
+                $event->toggle_visibility(true);
             } else {
             } else {
-                hide_event($event);
+                $event = new calendar_event($event);
+                $event->toggle_visibility(false);
             }
         }
     }
             }
         }
     }