Bugzilla – Attachment 3048 Details for
Bug 5681
Autobarcode using C4::Barcode has issues with leading zeros and large values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed Patch
0002-Bug-5681-Fixes-leading-zeroes-in-Add-Mulpiple-Copies.patch (text/plain), 1.50 KB, created by
Chris Cormack
on 2011-02-02 02:50:21 UTC
(
hide
)
Description:
Proposed Patch
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2011-02-02 02:50:21 UTC
Size:
1.50 KB
patch
obsolete
>From efee40c1841ce55eeb09710011e67c6a219d7f82 Mon Sep 17 00:00:00 2001 >From: Paul Poulain <paul.poulain@biblibre.com> >Date: Wed, 15 Dec 2010 20:28:03 +0100 >Subject: [PATCH] Bug 5681: Fixes leading zeroes in Add Mulpiple Copies >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >I don't know why, but removing sprintf solves the problems with leading zeroes >and the problems with large values. > >(written by jean-andré santoni) >--- > C4/Barcodes.pm | 9 +++------ > 1 files changed, 3 insertions(+), 6 deletions(-) > >diff --git a/C4/Barcodes.pm b/C4/Barcodes.pm >index 176d878..a528bd9 100644 >--- a/C4/Barcodes.pm >+++ b/C4/Barcodes.pm >@@ -135,14 +135,11 @@ sub next_value ($;$) { > # Note, this enlargement might be undesireable for some barcode formats. > # Those should override next_value() to work accordingly. > $incr++; >- my $width = $self->width || undef; >- # we would want to use %$x.$xd, but that would break on large values, like 2160700004168 >- # so we let the object tell us if it has a width to focus on. If not, we use float. >- my $format = ($width ? '%'."$width.$width".'d' : '%.0f'); >- $debug and warn "sprintf(\"$format\",$incr)"; >+ >+ $debug and warn "$incr"; > $head = $self->process_head($head,$max,$specific); > $tail = $self->process_tail($tail,$max,$specific); >- my $next_value = $head . sprintf($format,$incr) . $tail; >+ my $next_value = $head . $incr . $tail; > $debug and print STDERR "( next ) max barcode found: $next_value\n"; > return $next_value; > } >-- >1.7.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 5681
:
3048
|
3049