--- loncom/lonnet/perl/lonnet.pm 2003/03/26 04:57:04 1.353 +++ loncom/lonnet/perl/lonnet.pm 2003/03/28 21:20:16 1.356 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.353 2003/03/26 04:57:04 www Exp $ +# $Id: lonnet.pm,v 1.356 2003/03/28 21:20:16 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1198,11 +1198,13 @@ sub courseidput { sub courseiddump { my ($domfilter,$descfilter,$sincefilter)=@_; my %returnhash=(); + unless ($domfilter) { $domfilter=''; } foreach my $tryserver (keys %libserv) { - if ($hostdom{$tryserver}=~/$domfilter/) { + if ((!$domfilter) || ($hostdom{$tryserver} eq $domfilter)) { foreach ( split(/\&/,&reply('courseiddump:'.$hostdom{$tryserver}.':'. - $sincefilter.':'.&escape($descfilter)))) { + $sincefilter.':'.&escape($descfilter), + $tryserver))) { my ($key,$value)=split(/\=/,$_); if (($key) && ($value)) { $returnhash{&unescape($key)}=&unescape($value); @@ -3354,16 +3356,20 @@ sub metadata { $value.=' [Part: '.$part.']'; } my $unikey='parameter'.$keyroot.'_'.$name; - if ($subp eq 'default') { $unikey='parameter_0_'.$name; } - $metathesekeys{$unikey}=1; - $metacache{$uri.':'.$unikey.'.part'}=$part; + if ($subp eq 'default') { + $unikey='parameter_0_'.$name; + $metacache{$uri.':'.$unikey.'.part'}='0'; + } else { + $metacache{$uri.':'.$unikey.'.part'}=$part; + $metathesekeys{$unikey}=1; + } unless (defined($metacache{$uri.':'.$unikey.'.'.$subp})) { $metacache{$uri.':'.$unikey.'.'.$subp}=$value; } if (defined($metacache{$uri.':'.$unikey.'.default'})) { $metacache{$uri.':'.$unikey}= - $metacache{$uri.':'.$unikey.'.default'} - } + $metacache{$uri.':'.$unikey.'.default'}; + } } } } else { @@ -3459,7 +3465,7 @@ sub metadata_generate_part0 { if ($metakey=~/^parameter\_(.*)/) { my $part=$$metacache{$uri.':'.$metakey.'.part'}; my $name=$$metacache{$uri.':'.$metakey.'.name'}; - if (! exists($$metadata{'parameter_0_'.$name})) { + if (! exists($$metadata{'parameter_0_'.$name.'.name'})) { $allnames{$name}=$part; } }