Permalink
Browse files

MDL-34711 mod_forum Calling forum_trigger_content_uploaded_event only…

… with the course module set
  • Loading branch information...
1 parent 470d47f commit b53f4d55c8306e0ea0f5b11506c40de0b01d79be @dmonllao dmonllao committed Aug 3, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 mod/forum/lib.php
View
@@ -4437,7 +4437,9 @@ function forum_add_discussion($discussion, $mform=null, &$message=null, $userid=
}
// Let Moodle know that assessable content is uploaded (eg for plagiarism detection)
- forum_trigger_content_uploaded_event($post, $cm, 'forum_add_discussion');
+ if (!empty($cm->id)) {
+ forum_trigger_content_uploaded_event($post, $cm, 'forum_add_discussion');
+ }
return $post->discussion;
}

0 comments on commit b53f4d5

Please sign in to comment.