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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Thu, 24 Jan 2008 22:12:02 -0000


raeburn		Thu Jan 24 17:12:02 2008 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  Bridge Tasks are again listed as items for handgrading in the What's New page.
  (Disappearance was a result of code changes implemented to fix bug 5513).
  - Now array refs are being stored in navmap->{PARM_CACHE}->{$hashkey}, need to check that the zeroth indexed item is defined, instead of checking that the array ref itself is defined. (Similar to lonnet 1.938 change).
  - Check that $self->{PARM_CACHE}->{$hashkey} is a reference to an array instead of just assuming it is.
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.410 loncom/interface/lonnavmaps.pm:1.411
--- loncom/interface/lonnavmaps.pm:1.410	Sat Jan 19 20:52:47 2008
+++ loncom/interface/lonnavmaps.pm	Thu Jan 24 17:12:02 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.410 2008/01/20 01:52:47 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.411 2008/01/24 22:12:02 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2299,17 +2299,22 @@
     my $hashkey = $what."|||".$symb;
 
     if (defined($self->{PARM_CACHE}->{$hashkey})) {
-       if (wantarray) {
-           return @{$self->{PARM_CACHE}->{$hashkey}};
-       } else {
-           return $self->{PARM_CACHE}->{$hashkey}->[0];
-       }
+        if (ref($self->{PARM_CACHE}->{$hashkey}) eq 'ARRAY') { 
+            if (defined($self->{PARM_CACHE}->{$hashkey}->[0])) {
+                if (wantarray) {
+                    return @{$self->{PARM_CACHE}->{$hashkey}};
+                } else {
+                    return $self->{PARM_CACHE}->{$hashkey}->[0];
+                }
+            }
+        } else {
+            return $self->{PARM_CACHE}->{$hashkey};
+        }
     }
-
     my $result = $self->parmval_real($what, $symb, $recurse);
     $self->{PARM_CACHE}->{$hashkey} = $result;
     if (wantarray) {
-       return @{$result};
+        return @{$result};
     }
     return $result->[0];
 }