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

raeburn raeburn at source.lon-capa.org
Fri Dec 29 10:04:11 EST 2017


raeburn		Fri Dec 29 15:04:11 2017 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - Need to process removals in reverse order for splice() to work as expected.
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.645 loncom/interface/londocs.pm:1.646
--- loncom/interface/londocs.pm:1.645	Mon Dec 18 22:56:45 2017
+++ loncom/interface/londocs.pm	Fri Dec 29 15:04:11 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.645 2017/12/18 22:56:45 raeburn Exp $
+# $Id: londocs.pm,v 1.646 2017/12/29 15:04:11 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2795,7 +2795,8 @@
                     }
                 }
             }
-            for (my $i=0; $i<@LONCAPA::map::order; $i++) {
+            my $total = scalar(@LONCAPA::map::order) - 1;
+            for (my $i=$total; $i>=0; $i--) {
                 my $idx = $LONCAPA::map::order[$i];
                 if (defined($LONCAPA::map::resources[$idx])) {
                     my $changed;




More information about the LON-CAPA-cvs mailing list