Bugzilla – Attachment 46637 Details for
Bug 15572
Authority creation fails when authid is linked to 001 field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6657: TransformHtmlToMarc - rewrite the loop
Bug-6657-TransformHtmlToMarc---rewrite-the-loop.patch (text/plain), 2.32 KB, created by
Héctor Eduardo Castro Avalos
on 2016-01-14 04:41:35 UTC
(
hide
)
Description:
Bug 6657: TransformHtmlToMarc - rewrite the loop
Filename:
MIME Type:
Creator:
Héctor Eduardo Castro Avalos
Created:
2016-01-14 04:41:35 UTC
Size:
2.32 KB
patch
obsolete
>From 4eda9562951b9fcf2b7696bdd42a8bee2f7470fc Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Tue, 12 Jan 2016 16:49:15 +0100 >Subject: [PATCH] Bug 6657: TransformHtmlToMarc - rewrite the loop >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >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. > >http://bugs.koha-community.org/show_bug.cgi?id=15572 >--- > C4/Biblio.pm | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index f08fc37..10faa83 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -2515,13 +2515,12 @@ sub TransformHtmlToMarc { > > # creating a new record > my $record = MARC::Record->new(); >- my $i = 0; > my @fields; > my ($biblionumbertagfield, $biblionumbertagsubfield) = (-1, -1); > ($biblionumbertagfield, $biblionumbertagsubfield) = > &GetMarcFromKohaField( "biblio.biblionumber", '' ) if $isbiblio; > #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; > >@@ -2543,10 +2542,8 @@ sub TransformHtmlToMarc { > > if ( $tag < 10 ) { # no code for theses fields > # in MARC editor, 000 contains the leader. >- if ( $tag == $biblionumbertagfield ) { >- # We do nothing and let $i be incremented >- } >- elsif ( $tag eq '000' ) { >+ next if $tag == $biblionumbertagfield; >+ if ( $tag eq '000' ) { > # Force a fake leader even if not provided to avoid crashing > # during decoding MARC record containing UTF-8 characters > $record->leader( >@@ -2585,7 +2582,6 @@ sub TransformHtmlToMarc { > } > push @fields, $newfield if ($newfield); > } >- $i++; > } > > $record->append_fields(@fields); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15572
:
46619
|
46620
|
46621
|
46635
|
46636
|
46637
|
46641
|
46642
|
46643