--- loncom/interface/londocs.pm 2017/11/16 23:45:03 1.484.2.72.2.4 +++ loncom/interface/londocs.pm 2018/04/29 17:33:52 1.484.2.72.2.5 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.484.2.72.2.4 2017/11/16 23:45:03 raeburn Exp $ +# $Id: londocs.pm,v 1.484.2.72.2.5 2018/04/29 17:33:52 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2598,7 +2598,8 @@ sub apply_fixups { } } } - 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; @@ -2608,7 +2609,7 @@ sub apply_fixups { splice(@LONCAPA::map::order,$i,1); if (ref($currparam{$idx}) eq 'ARRAY') { foreach my $name (@{$currparam{$idx}}) { - &LONCAPA::map::delparameter($idx,'parameter_'.$name); + &LONCAPA::map::delparameter($idx,$name); } } next; @@ -2650,7 +2651,7 @@ sub apply_fixups { foreach my $idx (keys(%remparam)) { if (ref($remparam{$idx}) eq 'ARRAY') { foreach my $name (@{$remparam{$idx}}) { - &LONCAPA::map::delparameter($idx,'parameter_'.$name); + &LONCAPA::map::delparameter($idx,$name); } } }