Bug 5681 - Autobarcode using C4::Barcode has issues with leading zeros and large values
Summary: Autobarcode using C4::Barcode has issues with leading zeros and large values
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: 3.4
Hardware: All All
: PATCH-Sent (DO NOT USE) major
Assignee: Galen Charlton
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks: 5574
  Show dependency treegraph
 
Reported: 2011-02-02 02:49 UTC by Chris Cormack
Modified: 2012-10-25 23:04 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Proposed Patch (1.50 KB, patch)
2011-02-02 02:50 UTC, Chris Cormack
Details | Diff | Splinter Review
Signed off patch (1.87 KB, patch)
2011-02-02 03:45 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2011-02-02 02:49:04 UTC
This results in leading zeros being trimmed
Comment 1 Chris Cormack 2011-02-02 02:50:21 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2011-02-02 03:40:00 UTC
I have tested this patch, 

Before patch
ok 32 - (incremental ) Barcode Creation : new(incremental)
ok 33 - (incremental ) autoBarcode()    : incremental
ok 34 - (incremental ) initial()        : 0000001
# .    (incremental ) db_max()         : 0000001
ok 35 - (incremental ) max()            : 2
ok 36 - (incremental ) value()          : 2

After patch

ok 32 - (incremental ) Barcode Creation : new(incremental)
ok 33 - (incremental ) autoBarcode()    : incremental
ok 34 - (incremental ) initial()        : 0000001
# .    (incremental ) db_max()         : 0000001
ok 35 - (incremental ) max()            : 0000002
ok 36 - (incremental ) value()          : 0000002

I also checked the annual ones

Before
ok 2 - (annual      ) Barcode Creation : new(annual)
ok 3 - (annual      ) autoBarcode()    : annual
ok 4 - (annual      ) initial()        : 2011-0001
# .    (annual      ) db_max()         : 2011-18918291
ok 5 - (annual      ) max()            : 2011-18918292
ok 6 - (annual      ) value()          : 2011-18918292

after

ok 2 - (annual      ) Barcode Creation : new(annual)
ok 3 - (annual      ) autoBarcode()    : annual
ok 4 - (annual      ) initial()        : 2011-0001
# .    (annual      ) db_max()         : 2011-18918291
ok 5 - (annual      ) max()            : 2011-18918292
ok 6 - (annual      ) value()          : 2011-18918292

So patch does what it says it does, and does fix the stripping of leading zeros

Will sign off
Comment 3 Chris Cormack 2011-02-02 03:45:05 UTC
Created attachment 3049 [details] [review]
Signed off patch
Comment 4 Chris Cormack 2011-02-02 21:13:46 UTC
Pushed, please test