Bugzilla – Attachment 44869 Details for
Bug 6657
Making 999 visible in framework duplicates 999 entry and affects index
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 6657: Prevent biblionumber to be duplicated
PASSED-QA-Bug-6657-Prevent-biblionumber-to-be-dupl.patch (text/plain), 3.10 KB, created by
Katrin Fischer
on 2015-11-15 22:48:13 UTC
(
hide
)
Description:
[PASSED QA] Bug 6657: Prevent biblionumber to be duplicated
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2015-11-15 22:48:13 UTC
Size:
3.10 KB
patch
obsolete
>From 5c346ff702e1ce3bf0f12ad338a238b33ac1e790 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 17 Sep 2015 14:31:55 +0100 >Subject: [PATCH] [PASSED QA] Bug 6657: Prevent biblionumber to be duplicated > >If the biblionumber field is displayed in the framework, on editing a >biblio the field/subfield will be duplicated. >To prevent that this patch adds a check when building the field list. > >Test plan: >1/ map biblio.biblionumber with 999$c >2/ Display 999$c in a framework >3/ Edit a biblio using this framework >4/ Save => The field should not have been duplicated > >5/ map biblio.biblionumber with 001 >6/ Display 001 in a framework >7/ Edit a biblio using this framework >8/ Save => The field should not have been duplicated > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Works as described, aldo removes duplicate values. >No errors > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/Biblio.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 2e8827a..919051a 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -2517,6 +2517,7 @@ sub TransformHtmlToMarc { > 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 > my $param = $params[$i]; >@@ -2524,7 +2525,6 @@ sub TransformHtmlToMarc { > > # if we are on biblionumber, store it in the MARC::Record (it may not be in the edited fields) > if ( $param eq 'biblionumber' ) { >- my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' ); > if ( $biblionumbertagfield < 10 ) { > $newfield = MARC::Field->new( $biblionumbertagfield, $cgi->param($param), ); > } else { >@@ -2541,6 +2541,7 @@ sub TransformHtmlToMarc { > > if ( $tag < 10 ) { # no code for theses fields > # in MARC editor, 000 contains the leader. >+ 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 >@@ -2560,6 +2561,7 @@ sub TransformHtmlToMarc { > # browse subfields for this tag (reason for _code_ match) > while(defined $params[$j] && $params[$j] =~ /_code_/) { > last unless defined $params[$j+1]; >+ $j += 2 and next if $tag == $biblionumbertagfield and $cgi->param($params[$j]) eq $biblionumbertagsubfield; > #if next param ne subfield, then it was probably empty > #try next param by incrementing j > if($params[$j+1]!~/_subfield_/) {$j++; next; } >-- >1.9.1
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 6657
:
42667
|
44199
|
44869
|
46517
|
46536
|
46537
|
46538
|
46542
|
46543
|
46544
|
46545
|
46547
|
46568
|
46569