Bugzilla – Attachment 122420 Details for
Bug 28384
Add 'no_items' option to TransformMarcToKoha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28384: (follow-up) TransformMarcToKohaOneField should allow zeroes
Bug-28384-follow-up-TransformMarcToKohaOneField-sh.patch (text/plain), 1.57 KB, created by
Marcel de Rooy
on 2021-06-25 08:47:32 UTC
(
hide
)
Description:
Bug 28384: (follow-up) TransformMarcToKohaOneField should allow zeroes
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-06-25 08:47:32 UTC
Size:
1.57 KB
patch
obsolete
>From 8fc876a731a819d2c761d7cbb7bae9d8ffae240b Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 25 Jun 2021 07:45:32 +0000 >Subject: [PATCH] Bug 28384: (follow-up) TransformMarcToKohaOneField should > allow zeroes >Content-Type: text/plain; charset=utf-8 > >Until now, the test did not pass false values like '0' or ''. >But we should pass '0' and not ''. > >Note that the test for control fields is a bit theoretical since >we dont have control fields bound to Koha fields currently. > >The adjusted unit test in the former patch should now pass. > >Test plan: >Run TransformMarcToKoha.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Since this change theoretically has a larger impact, I also >tested the cataloguing editor, item editor. And run quite a >few tests referring to AddBiblio or ModBiblio. >--- > C4/Biblio.pm | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 8aeef65c96..242dd90057 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -2422,9 +2422,10 @@ sub TransformMarcToKohaOneField { > my $sub = $fldhash->{tagsubfield}; > foreach my $fld ( $marc->field($tag) ) { > if( $sub eq '@' || $fld->is_control_field ) { >- push @rv, $fld->data if $fld->data; >+ my $data = $fld->data; >+ push @rv, $data if defined $data && $data ne ''; > } else { >- push @rv, grep { $_ } $fld->subfield($sub); >+ push @rv, grep { defined $_ && $_ ne '' } $fld->subfield($sub); > } > } > } >-- >2.20.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 28384
:
121146
|
121150
|
122418
|
122419
|
122420