--- loncom/lonnet/perl/lonnet.pm 2007/08/10 23:02:36 1.906 +++ loncom/lonnet/perl/lonnet.pm 2007/08/31 12:33:29 1.909 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.906 2007/08/10 23:02:36 albertel Exp $ +# $Id: lonnet.pm,v 1.909 2007/08/31 12:33:29 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -861,6 +861,7 @@ sub inst_directory_query { my $udom = $srch->{'srchdomain'}; my %results; my $homeserver = &domain($udom,'primary'); + my $outcome; if ($homeserver ne '') { my $queryid=&reply("querysend:instdirsearch:". &escape($srch->{'srchby'}).':'. @@ -880,14 +881,19 @@ sub inst_directory_query { } if (!&error($response) && $response ne 'refused') { - my @matches = split(/\n/,$response); - foreach my $match (@matches) { - my ($key,$value) = split(/=/,$match); - $results{&unescape($key).':'.$udom} = &thaw_unescape($value); + if ($response eq 'unavailable') { + $outcome = $response; + } else { + $outcome = 'ok'; + my @matches = split(/\n/,$response); + foreach my $match (@matches) { + my ($key,$value) = split(/=/,$match); + $results{&unescape($key).':'.$udom} = &thaw_unescape($value); + } } } } - return %results; + return ($outcome,%results); } sub usersearch { @@ -6696,10 +6702,11 @@ sub metadata { # only ws inside the tag, and not in default, so use default # as value $metaentry{':'.$unikey}=$default; - } else { - # either something interesting inside the tag or default - # uninteresting + } elsif ( $internaltext =~ /\S/ ) { + # something interesting inside the tag $metaentry{':'.$unikey}=$internaltext; + } else { + # no interesting values, don't set a default } # end of not-a-package not-a-library import } @@ -6839,12 +6846,15 @@ sub gettitle { } my ($map,$resid,$url)=&decode_symb($symb); my $title=''; - my %bighash; - if (tie(%bighash,'GDBM_File',$env{'request.course.fn'}.'.db', - &GDBM_READER(),0640)) { - my $mapid=$bighash{'map_pc_'.&clutter($map)}; - $title=$bighash{'title_'.$mapid.'.'.$resid}; - untie %bighash; + if (!$map && $resid == 0 && $url =~/default\.sequence$/) { + $title = $env{'course.'.$env{'request.course.id'}.'.description'}; + } else { + if (tie(my %bighash,'GDBM_File',$env{'request.course.fn'}.'.db', + &GDBM_READER(),0640)) { + my $mapid=$bighash{'map_pc_'.&clutter($map)}; + $title=$bighash{'title_'.$mapid.'.'.$resid}; + untie(%bighash); + } } $title=~s/\&colon\;/\:/gs; if ($title) {