[LON-CAPA-cvs] cvs: loncom(version_2_8_X) /interface lonfeedback.pm

raeburn raeburn@source.lon-capa.org
Sun, 21 Dec 2008 16:18:04 -0000


raeburn		Sun Dec 21 16:18:04 2008 EDT

  Modified files:              (Branch: version_2_8_X)
    /loncom/interface	lonfeedback.pm 
  Log:
  - Backport 1.260.
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.255.2.1 loncom/interface/lonfeedback.pm:1.255.2.2
--- loncom/interface/lonfeedback.pm:1.255.2.1	Sat Dec 13 04:19:27 2008
+++ loncom/interface/lonfeedback.pm	Sun Dec 21 16:18:04 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.255.2.1 2008/12/13 04:19:27 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.255.2.2 2008/12/21 16:18:04 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3247,12 +3247,18 @@
 sub has_discussion {
     my $resourcesref = shift;
     my $navmap = Apache::lonnavmaps::navmap->new();
-    my @allres=$navmap->retrieveResources();
-    foreach my $resource (@allres) {
-        if ($resource->hasDiscussion()) {
-            my $ressymb = $resource->wrap_symb();
-            push(@{$resourcesref}, $ressymb);
+    if (defined($navmap)) {
+        my @allres=$navmap->retrieveResources();
+        foreach my $resource (@allres) {
+            if ($resource->hasDiscussion()) {
+                my $ressymb = $resource->wrap_symb();
+                if (ref($resourcesref) eq 'ARRAY') {
+                    push(@{$resourcesref}, $ressymb);
+                }
+            }
         }
+    } else {
+        &Apache::lonnet::logthis('Has discussion check failed - could not create navmap object.');
     }
     return;
 }
@@ -3654,7 +3660,7 @@
   } else {
 # ------------------------------------------------------------- Normal feedback
       my $feedurl=$env{'form.postdata'};
-      $feedurl=~s/^http\:\/\///;
+      $feedurl=~s/^https?\:\/\///;
       $feedurl=~s/^$ENV{'SERVER_NAME'}//;
       $feedurl=~s/^$ENV{'HTTP_HOST'}//;
       $feedurl=~s/\?.+$//;