We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68adb39 commit a410bcbCopy full SHA for a410bcb
lib.php
@@ -164,14 +164,13 @@ function oublog_delete_instance($oublogid) {
164
// instances
165
$DB->delete_records('oublog_instances', array('oublogid'=>$oublog->id));
166
167
+ if (!$cm = get_coursemodule_from_instance('oublog', $oublog->id)) {
168
+ throw new moodle_exception('invalidcoursemodule');
169
+ }
170
+
171
// Fulltext search data
172
require_once(dirname(__FILE__).'/locallib.php');
173
if (oublog_search_installed()) {
- $moduleid=$DB->get_field('modules', 'id', array('name'=>'oublog'));
- $cm=$DB->get_record('course_modules', array('module'=>$moduleid, 'instance'=>$oublog->id));
- if (!$cm) {
- throw new moodle_exception('invalidcoursemodule');
174
- }
175
local_ousearch_document::delete_module_instance_data($cm);
176
}
177
0 commit comments