Permalink
Browse files

Merge branch 'wip-mdl-31623-m22' of git://github.com/rajeshtaneja/moo…

…dle into MOODLE_22_STABLE
  • Loading branch information...
2 parents 2335d65 + 91de7cb commit 12f57ec9c3942dd8d0addc64340555699b17c8f7 @nebgor nebgor committed Aug 29, 2012
Showing with 6 additions and 6 deletions.
  1. +3 −3 course/reset_form.php
  2. +3 −3 lib/moodlelib.php
View
@@ -58,13 +58,13 @@ function definition (){
if ($allmods = $DB->get_records('modules') ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
- if (!$DB->count_records($modname, array('course'=>$COURSE->id))) {
- continue; // skip mods with no instances
- }
$modfile = $CFG->dirroot."/mod/$modname/lib.php";
$mod_reset_course_form_definition = $modname.'_reset_course_form_definition';
$mod_reset__userdata = $modname.'_reset_userdata';
if (file_exists($modfile)) {
+ if (!$DB->count_records($modname, array('course'=>$COURSE->id))) {
+ continue; // Skip mods with no instances
+ }
include_once($modfile);
if (function_exists($mod_reset_course_form_definition)) {
$mod_reset_course_form_definition($mform);
View
@@ -4857,12 +4857,12 @@ function reset_course_userdata($data) {
if ($allmods = $DB->get_records('modules') ) {
foreach ($allmods as $mod) {
$modname = $mod->name;
- if (!$DB->count_records($modname, array('course'=>$data->courseid))) {
- continue; // skip mods with no instances
- }
$modfile = $CFG->dirroot.'/mod/'. $modname.'/lib.php';
$moddeleteuserdata = $modname.'_reset_userdata'; // Function to delete user data
if (file_exists($modfile)) {
+ if (!$DB->count_records($modname, array('course'=>$data->courseid))) {
+ continue; // Skip mods with no instances
+ }
include_once($modfile);
if (function_exists($moddeleteuserdata)) {
$modstatus = $moddeleteuserdata($data);

0 comments on commit 12f57ec

Please sign in to comment.