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

raeburn raeburn at source.lon-capa.org
Sun Apr 3 20:34:37 EDT 2016


raeburn		Mon Apr  4 00:34:37 2016 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  - Sanity checking.
  - Remove call to lonnet::clutter() since getResourceByUrl() already does it.
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.518 loncom/interface/lonnavmaps.pm:1.519
--- loncom/interface/lonnavmaps.pm:1.518	Mon Mar 28 12:39:43 2016
+++ loncom/interface/lonnavmaps.pm	Mon Apr  4 00:34:37 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.518 2016/03/28 12:39:43 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.519 2016/04/04 00:34:37 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2788,11 +2788,14 @@
     my ($self,$mapname) = @_;
     my @recurseup;
     if ($mapname) {
-        my @pcs = split(/,/,$self->getResourceByUrl(&Apache::lonnet::clutter($mapname))->map_hierarchy());
-        shift(@pcs);
-        pop(@pcs);
-        if (@pcs) {
-            @recurseup = map { &Apache::lonnet::declutter($self->getByMapPc($_)->src()); } reverse(@pcs);
+        my $res = $self->getResourceByUrl($mapname);
+        if (ref($res)) {
+            my @pcs = split(/,/,$res->map_hierarchy());
+            shift(@pcs);
+            pop(@pcs);
+            if (@pcs) {
+                @recurseup = map { &Apache::lonnet::declutter($self->getByMapPc($_)->src()); } reverse(@pcs);
+            }
         }
     }
     return @recurseup;




More information about the LON-CAPA-cvs mailing list