--- loncom/interface/coursecatalog.pm 2008/01/12 22:32:04 1.25 +++ loncom/interface/coursecatalog.pm 2008/02/15 02:30:14 1.26 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler for displaying the course catalog interface # -# $Id: coursecatalog.pm,v 1.25 2008/01/12 22:32:04 raeburn Exp $ +# $Id: coursecatalog.pm,v 1.26 2008/02/15 02:30:14 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -231,8 +231,10 @@ function setCourseId(caller) { $r->print(&mt('Choose which course(s) to list.
')); $r->print(''); for (my $k=0; $k<$lasttitle-1; $k++) { - my @unsorted = @{$cat_items{$codetitles[$k]}}; - my @items; + my (@items,@unsorted); + if (ref($cat_items{$codetitles[$k]}) eq 'ARRAY') { + @unsorted = @{$cat_items{$codetitles[$k]}}; + } &Apache::courseclassifier::sort_cats($k,\%cat_order,\@codetitles,\@unsorted,\@items); my @longitems; if (defined($cat_titles{$codetitles[$k]})) {