--- loncom/interface/coursecatalog.pm 2021/06/15 20:52:26 1.105 +++ loncom/interface/coursecatalog.pm 2025/02/24 13:40:33 1.107 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler for displaying the course catalog interface # -# $Id: coursecatalog.pm,v 1.105 2021/06/15 20:52:26 raeburn Exp $ +# $Id: coursecatalog.pm,v 1.107 2025/02/24 13:40:33 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -357,8 +357,12 @@ function check_selected() { } ENDJS } - $catjs = ''; - &cat_header($r,$codedom,$catjs,\%add_entries,$catlinks,undef,$cattype); + my $js = ''; + &cat_header($r,$codedom,$js,\%add_entries,$catlinks,undef,$cattype); if ($env{'form.currcat_0'} ne '') { $r->print('
'. @@ -1891,7 +1895,13 @@ sub courseinfo_row { @cats = split('&',$categories); } if ((ref($trails) eq 'ARRAY') && (ref($allitems) eq 'HASH')) { - my @categories = map { $trails->[$allitems->{$_}]; } @cats; + my @categories; + foreach my $cat (@cats) { + next if ($cat eq ''); + if (($allitems->{$cat} ne '') && ($trails->[$allitems->{$cat}] ne '')) { + push(@categories,$trails->[$allitems->{$cat}]); + } + } $categorylist = join('
',@categories); } if ($categorylist eq '') {