--- loncom/interface/longroup.pm 2010/02/23 14:18:12 1.24 +++ loncom/interface/longroup.pm 2012/12/18 15:26:03 1.29 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # accessor routines used to provide information about course groups # -# $Id: longroup.pm,v 1.24 2010/02/23 14:18:12 raeburn Exp $ +# $Id: longroup.pm,v 1.29 2012/12/18 15:26:03 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -218,7 +218,7 @@ for the course is included amongst the u and would trigger membership in teh same group(s) If role is being added, will add any group memberships specified -for auto-group population, unless use is already a group member. +for auto-group population, unless user is already a group member. Uses default group privileges and default start and end group access times. @@ -252,9 +252,6 @@ sub group_changes { } else { $cid = $url; } - my $courseid = $cid; - $courseid =~ s|^/||; - $courseid =~ s|/|_|; my %crshash=&Apache::lonnet::coursedescription($cid); $cdom = $crshash{'domain'}; $cnum = $crshash{'num'}; @@ -292,10 +289,7 @@ sub group_changes { if (@changegroups > 0) { my %currpriv; my %roleshash = &Apache::lonnet::dump('roles',$udom,$uname,$cid); - if (my $tmp = &Apache::lonnet::error(%roleshash)) { - &Apache::lonnet::logthis('Error retrieving roles: '.$tmp. - ' for '.$uname.':'.$udom); - } else { + if (keys(%roleshash) > 0) { my $group_privs = ''; foreach my $group (@changegroups) { if ($chgtype eq 'add') { @@ -693,9 +687,14 @@ sub get_group_link { if (ref($navmap)) { my $symb = 'uploaded/'.$cdom.'/'.$cnum.'/group_folder_'.$group.'.sequence___1___adm/'.$cdom.'/'.$cnum.'/'.$group.'/smppg'; my $res = $navmap->getBySymb($symb); - my $link = $res->link(); - $link .= (($link=~/\?/)?'&':'?').'symb='.$res->shown_symb(); - return $link; + my $link; + if (ref($res)) { + $link = $res->link(); + $link .= (($link=~/\?/)?'&':'?').'symb='.$res->shown_symb(); + } else { + $link = '/adm/'.$cdom.'/'.$cnum.'/'.$group.'/smppg'; + } + return $link; } return; }