[LON-CAPA-cvs] cvs: loncom /interface coursecatalog.pm

raeburn raeburn at source.lon-capa.org
Mon Feb 24 08:40:33 EST 2025


raeburn		Mon Feb 24 13:40:33 2025 EDT

  Modified files:              
    /loncom/interface	coursecatalog.pm 
  Log:
  - If sub-category assigned to an "unofficial" course has been subsequently
    removed from the categories defined in the domain configuration for the 
    course's domain skip it when creating the categories entry to display.
  
  
Index: loncom/interface/coursecatalog.pm
diff -u loncom/interface/coursecatalog.pm:1.106 loncom/interface/coursecatalog.pm:1.107
--- loncom/interface/coursecatalog.pm:1.106	Sat Feb 15 00:07:48 2025
+++ loncom/interface/coursecatalog.pm	Mon Feb 24 13:40:33 2025
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler for displaying the course catalog interface
 #
-# $Id: coursecatalog.pm,v 1.106 2025/02/15 00:07:48 raeburn Exp $
+# $Id: coursecatalog.pm,v 1.107 2025/02/24 13:40:33 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1895,7 +1895,13 @@
             @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('<br />', at categories);
         }
         if ($categorylist eq '') {




More information about the LON-CAPA-cvs mailing list