Bugzilla – Attachment 97191 Details for
Bug 9156
System preference itemcallnumber not pulling more than 2 subfields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9156: (follow-up) Simpliy code
Bug-9156-follow-up-Simpliy-code.patch (text/plain), 1.65 KB, created by
Jonathan Druart
on 2020-01-10 12:28:13 UTC
(
hide
)
Description:
Bug 9156: (follow-up) Simpliy code
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-01-10 12:28:13 UTC
Size:
1.65 KB
patch
obsolete
>From 221615b2aad2856145fad0bdfde4de2f985b004c Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 19 Dec 2019 19:05:36 +0000 >Subject: [PATCH] Bug 9156: (follow-up) Simpliy code > >The MARC::Field as_string method can join multiple subfield using a delimiter, this simplifies the code here > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > cataloguing/additem.pl | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 38fb34bc3c..babf6d3d4c 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -156,18 +156,10 @@ sub generate_subfield_form { > if (!$value && $subfieldlib->{kohafield} eq 'items.itemcallnumber' && $pref_itemcallnumber) { > my $CNtag = substr( $pref_itemcallnumber, 0, 3 ); # 3-digit tag number > my $CNsubfields = substr( $pref_itemcallnumber, 3 ); # Any and all subfields >- my @subfields = ( $CNsubfields =~ m/./g ); # Split into single-character elements > my $temp2 = $temp->field($CNtag); > > if ($temp2) { >- my @selectedsubfields; >- foreach my $subfieldcode( @subfields ){ >- push @selectedsubfields, $temp2->subfield( $subfieldcode ); >- } >- $value = join( ' ', @selectedsubfields ); >- >- #remove any trailing space incase one subfield is used >- $value =~ s/^\s+|\s+$//g; >+ $value = $temp2->as_string( $CNsubfields, ' ' ); > } > } > >-- >2.11.0
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 9156
:
13711
|
13712
|
95580
|
96486
|
96499
|
96764
|
96766
|
96767
|
96792
|
97190
| 97191 |
97192