Bugzilla – Attachment 101072 Details for
Bug 23900
Label maker cannot concatenate database fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23900: Teach label maker to concat database fields
Bug-23900-Teach-label-maker-to-concat-database-fie.patch (text/plain), 1.70 KB, created by
Kyle M Hall (khall)
on 2020-03-20 11:04:42 UTC
(
hide
)
Description:
Bug 23900: Teach label maker to concat database fields
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-03-20 11:04:42 UTC
Size:
1.70 KB
patch
obsolete
>From 422ee8d07f5d91d742c92c62d4e2241b69d9752c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 11 Nov 2019 17:54:56 +0100 >Subject: [PATCH] Bug 23900: Teach label maker to concat database fields > >Test plan: >- define a label layout with this field list: "100a 245s","enumchron copynumber" >- find or create a record with values for all of those fields >- generate a label for that record >- the 100a and 245s successfully display on one line >- the enumchron and copynumber are displayed and separated by a space > >Try other combinations > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Labels/Label.pm | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > >diff --git a/C4/Labels/Label.pm b/C4/Labels/Label.pm >index 0a1d0a0e53..0fafd7d9d3 100644 >--- a/C4/Labels/Label.pm >+++ b/C4/Labels/Label.pm >@@ -148,11 +148,16 @@ sub _get_barcode_data { > next FIELD_LIST; > } > elsif ( $f =~ /^($match_kohatable).*/ ) { >- if ($item->{$f}) { >- $datastring .= $item->{$f}; >- } else { >- $debug and warn sprintf("The '%s' field contains no data.", $f); >+ my @fields = split ' ', $f; >+ my @data; >+ for my $field ( @fields ) { >+ if ($item->{$field}) { >+ push @data, $item->{$field}; >+ } else { >+ $debug and warn sprintf("The '%s' field contains no data.", $field); >+ } > } >+ $datastring .= join ' ', @data; > $f = $'; > next FIELD_LIST; > } >-- >2.21.1 (Apple Git-122.3)
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 23900
:
95273
|
95307
|
99641
| 101072 |
101073