Skip to content

Commit 9823527

Browse files
committed
replace deprecated error() function
1 parent be54d66 commit 9823527

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

model/annotation.class.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@ public static function deletion_allowed($annotation, $cmid) {
153153
$result = [];
154154

155155
// If user has admin rights with regard to annotations/comments: Allow deletion.
156-
if (!$cm = get_coursemodule_from_id('pdfannotator', $cmid)) {
157-
error("Course module ID was incorrect");
158-
}
156+
$cm = get_coursemodule_from_id('pdfannotator', $cmid, 0, false, MUST_EXIST);
159157
$context = context_module::instance($cm->id);
160158
$deleteany = has_capability('mod/pdfannotator:deleteany', $context);
161159
$deleteown = has_capability('mod/pdfannotator:deleteown', $context);

0 commit comments

Comments
 (0)