Bug 15572: TransformHtmlToMarc - rewrite the loop

This rewrites the while loop into a for loop, so $i still gets
incremented when we call next

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
  Make sense. Add readability. Infinite loop no more possible.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
This commit is contained in:
Julian Maurice 2016-01-12 16:49:15 +01:00 committed by Jesse Weaver
parent 8db6b0f533
commit 1eab5c199d
1 changed files with 1 additions and 3 deletions

View File

@ -2515,11 +2515,10 @@ sub TransformHtmlToMarc {
# creating a new record
my $record = MARC::Record->new();
my $i = 0;
my @fields;
my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' );
#FIXME This code assumes that the CGI params will be in the same order as the fields in the template; this is no absolute guarantee!
while ( $params[$i] ) { # browse all CGI params
for (my $i = 0; $params[$i]; $i++ ) { # browse all CGI params
my $param = $params[$i];
my $newfield = 0;
@ -2579,7 +2578,6 @@ sub TransformHtmlToMarc {
}
push @fields, $newfield if ($newfield);
}
$i++;
}
$record->append_fields(@fields);