--- loncom/interface/loncoursedata.pm 2016/04/25 23:00:58 1.197 +++ loncom/interface/loncoursedata.pm 2016/04/26 13:51:38 1.198 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursedata.pm,v 1.197 2016/04/25 23:00:58 raeburn Exp $ +# $Id: loncoursedata.pm,v 1.198 2016/04/26 13:51:38 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1306,7 +1306,11 @@ sub ensure_current_groups { if ($cdom eq '' || $cnum eq '') { return 'error: invalid course'; } - &ensure_tables_are_set_up($courseid); + &setup_table_names($courseid); + my @CurrentTables = &Apache::lonmysql::tables_in_db(); + unless (grep(/^\Q$groupnames_table\E$/,@CurrentTables)) { + return; + } # Get the update time for the groupnames table my $getuserdir = 1; my $modifiedtime = &Apache::lonnet::GetFileTimestamp @@ -1316,7 +1320,6 @@ sub ensure_current_groups { if ($tableinfo{'Update_time'}) { $updatetime = $tableinfo{'Update_time'}; } - print STDERR "1. updatetime is ||$updatetime|| and modifidtime is ||$modifiedtime||\n"; if (! defined($updatetime) || $modifiedtime > $updatetime) { my (%groups_in_sql,%removegroups,$addgroup); my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum); @@ -1367,7 +1370,11 @@ sub ensure_current_students_groups { $cdom = $env{'course.'.$courseid.'.domain'}; $cnum = $env{'course.'.$courseid.'.num'}; } - &ensure_tables_are_set_up($courseid); + &setup_table_names($courseid); + my @CurrentTables = &Apache::lonmysql::tables_in_db(); + unless (grep(/^\Q$students_groups_table\E$/,@CurrentTables)) { + return; + } # Get the update time for the groupnames table my $getuserdir = 1; my $modifiedtime = &Apache::lonnet::GetFileTimestamp @@ -1377,7 +1384,6 @@ sub ensure_current_students_groups { if ($tableinfo{'Update_time'}) { $updatetime = $tableinfo{'Update_time'}; } - print STDERR "2. updatetime is ||$updatetime|| and modifidtime is ||$modifiedtime||\n"; if ((!defined($updatetime)) || ($modifiedtime > $updatetime)) { if (&Apache::lonmysql::drop_table($students_groups_table)) { if (&init_dbs($courseid)) {