File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -164,14 +164,13 @@ function oublog_delete_instance($oublogid) {
164164 // instances
165165 $ DB ->delete_records ('oublog_instances ' , array ('oublogid ' =>$ oublog ->id ));
166166
167+ if (!$ cm = get_coursemodule_from_instance ('oublog ' , $ oublog ->id )) {
168+ print_error ('invalidcoursemodule ' );
169+ }
170+
167171 // Fulltext search data
168172 require_once (dirname (__FILE__ ).'/locallib.php ' );
169173 if (oublog_search_installed ()) {
170- $ moduleid =$ DB ->get_field ('modules ' , 'id ' , array ('name ' =>'oublog ' ));
171- $ cm =$ DB ->get_record ('course_modules ' , array ('module ' =>$ moduleid , 'instance ' =>$ oublog ->id ));
172- if (!$ cm ) {
173- print_error ('invalidcoursemodule ' );
174- }
175174 local_ousearch_document::delete_module_instance_data ($ cm );
176175 }
177176
You can’t perform that action at this time.
0 commit comments