--- loncom/lond 2008/06/30 03:59:23 1.406 +++ loncom/lond 2008/07/07 15:23:41 1.407 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.406 2008/06/30 03:59:23 raeburn Exp $ +# $Id: lond,v 1.407 2008/07/07 15:23:41 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -59,7 +59,7 @@ my $DEBUG = 0; # Non zero to ena my $status=''; my $lastlog=''; -my $VERSION='$Revision: 1.406 $'; #' stupid emacs +my $VERSION='$Revision: 1.407 $'; #' stupid emacs my $remoteVERSION; my $currenthostid="default"; my $currentdomainid; @@ -3619,9 +3619,9 @@ sub put_course_id_hash_handler { # now or in the future (selfenrollonly = 1). # catfilter - filter by course category, assigned to a course # using manually defined categories (i.e., not -# self-cataloging based on onstitutional code). +# self-cataloging based on on institutional code). # showhidden - include course in results even if course -# was set to be excluded from course catalog (DC only). +# was set to be excluded from course catalog (DC only). # caller - if set to 'coursecatalog', courses set to be hidden # from course catalog will be excluded from results (unless # overridden by "showhidden". @@ -3723,8 +3723,16 @@ sub dump_course_id_handler { if ($catfilter ne '') { next if ($items->{'categories'} eq ''); my @categories = split('&',$items->{'categories'}); - next if ((@categories == 0) || - (!grep(/^\Q$catfilter\E$/,@categories))); + next if (@categories == 0); + my @subcats = split('&',$catfilter); + my $matchcat = 0; + foreach my $cat (@categories) { + if (grep(/^\Q$cat\E$/,@subcats)) { + $matchcat = 1; + last; + } + } + next if (!$matchcat); } if ($caller eq 'coursecatalog') { if ($items->{'hidefromcat'} eq 'yes') {