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

raeburn raeburn at source.lon-capa.org
Tue Jun 23 12:09:43 EDT 2015


raeburn		Tue Jun 23 16:09:43 2015 EDT

  Modified files:              
    /loncom/interface	slotrequest.pm 
  Log:
  - Sanity checking to avoid ISE in the case where a slot was reserved for a
    resource which is now hidden, or has been removed from the course.
  
  
Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.122 loncom/interface/slotrequest.pm:1.123
--- loncom/interface/slotrequest.pm:1.122	Sun May 10 03:58:12 2015
+++ loncom/interface/slotrequest.pm	Tue Jun 23 16:09:43 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler for requesting to have slots added to a students record
 #
-# $Id: slotrequest.pm,v 1.122 2015/05/10 03:58:12 raeburn Exp $
+# $Id: slotrequest.pm,v 1.123 2015/06/23 16:09:43 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -689,14 +689,20 @@
         return (0,'error: Unable to determine current status');
     }
     my $passed_resource = $navmap->getBySymb($symb);
-    if ($passed_resource->is_map()) {
-	my ($a_resource) = 
-	    $navmap->retrieveResources($passed_resource, 
-				       sub {$_[0]->is_problem()},0,1);
-	$symb = $a_resource->symb();
+    if (ref($passed_resource)) {
+        if ($passed_resource->is_map()) {
+	    my ($a_resource) = 
+                $navmap->retrieveResources($passed_resource, 
+                                           sub {$_[0]->is_problem()},0,1);
+            $symb = $a_resource->symb();
+        }
+    } else {
+        unless ($mgr eq 'F') {
+            return (0,'error: Unable to determine current status');
+        }
     }
 
-    # get parameter string, check for existance, rebuild string with the slot
+    # get parameter string, check for existence, rebuild string with the slot
     my $student = &Apache::lonnet::EXT("resource.0.availablestudent",
                                        $symb,$udom,$uname);
     my @slots = split(/:/,$student);




More information about the LON-CAPA-cvs mailing list