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

raeburn raeburn at source.lon-capa.org
Tue May 6 14:09:41 EDT 2014


raeburn		Tue May  6 18:09:41 2014 EDT

  Modified files:              
    /loncom/interface	lonrequestcourse.pm 
  Log:
  - Eliminate javascript error when no textbooks have been assigned in the 
    domain.
  
  
Index: loncom/interface/lonrequestcourse.pm
diff -u loncom/interface/lonrequestcourse.pm:1.78 loncom/interface/lonrequestcourse.pm:1.79
--- loncom/interface/lonrequestcourse.pm:1.78	Wed Apr 16 14:40:17 2014
+++ loncom/interface/lonrequestcourse.pm	Tue May  6 18:09:40 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Request a course
 #
-# $Id: lonrequestcourse.pm,v 1.78 2014/04/16 14:40:17 raeburn Exp $
+# $Id: lonrequestcourse.pm,v 1.79 2014/05/06 18:09:40 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3739,6 +3739,20 @@
                 if ($code) {
                     $reqhash{'code'} = $code;
                 }
+                if (ref($postprocess) eq 'HASH') {
+                    if (ref($postprocess->{'createdactions'}) eq 'HASH') {
+                        if (ref($postprocess->{'createdactions'}{'environment'} eq 'HASH') {
+                            my %newcrsenv;
+                            foreach my $key (%{$postprocess->{'createdactions'}{'environment'}}) {
+                                $newcrsenv{$key} = $postprocess->{'createdactions'}{'environment'}{$key};
+                            }
+                            if (keys(%newcrsenv)) {
+                                my $putresult = &Apache::lonnet::put('environment',\%newcrsenv,$dom,$cnum);
+
+                            }
+                        }
+                    }
+                }
                 $output .= '<br />'.$role_result.'</p>';
                 $creationresult = 'created';
             } else {
@@ -4390,7 +4404,7 @@
 #
 #  Retrieve list of textbook courses cloneable by user
 #
-    my $numbook;
+    my $numbook = 0;
     if (ref($settings) eq 'HASH') {
         $bookshash = $settings->{'textbooks'};
         if (ref($bookshash) eq 'HASH') {




More information about the LON-CAPA-cvs mailing list