--- loncom/interface/londocs.pm 2017/12/18 22:56:45 1.645 +++ loncom/interface/londocs.pm 2017/12/29 15:11:18 1.647 @@ -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.647 2017/12/29 15:11:18 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2795,7 +2795,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; @@ -2805,7 +2806,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; @@ -2847,7 +2848,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); } } }