[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm

raeburn raeburn at source.lon-capa.org
Tue Sep 13 11:40:37 EDT 2011


raeburn		Tue Sep 13 15:40:37 2011 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  - Prevent ISE when browsing resources outside course context.
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.495 loncom/homework/structuretags.pm:1.496
--- loncom/homework/structuretags.pm:1.495	Thu Jul 28 03:13:58 2011
+++ loncom/homework/structuretags.pm	Tue Sep 13 15:40:37 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.495 2011/07/28 03:13:58 raeburn Exp $
+# $Id: structuretags.pm,v 1.496 2011/09/13 15:40:37 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -208,7 +208,11 @@
                 my $navmap = Apache::lonnavmaps::navmap->new();
                 if (ref($navmap)) {
                     my $mapres = $navmap->getResourceByUrl($map);
-                    unless ($mapres->is_page()) {
+                    my $is_page;
+                    if (ref($mapres)) {
+                        $is_page = $mapres->is_page();
+                    }
+                    unless ($is_page) {
                         $needs_upload = 1;
                     }
                 }
@@ -218,7 +222,11 @@
                 my $navmap = Apache::lonnavmaps::navmap->new();
                 if (ref($navmap)) {
                     my $mapres = $navmap->getResourceByUrl($map);
-                    unless ($mapres->is_page()) {
+                    my $is_page;
+                    if (ref($mapres)) {
+                        $is_page = $mapres->is_page();
+                    }
+                    unless ($is_page) {
                         my $res = $navmap->getBySymb($symb);
                         if (ref($res)) {
                             my $partlist = $res->parts();




More information about the LON-CAPA-cvs mailing list