Bug 10305 - _increment_barcode is called twice
Summary: _increment_barcode is called twice
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Kyle M Hall
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-21 19:58 UTC by Kyle M Hall
Modified: 2014-05-26 21:04 UTC (History)
4 users (show)

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


Attachments
Bug 10305 - Duplicate code in Search.pm (1.13 KB, patch)
2013-05-21 20:00 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 10305 - _increment_barcode is called twice (1.14 KB, patch)
2013-08-09 13:25 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 10305 - _increment_barcode is called twice (1.23 KB, patch)
2013-09-23 12:31 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2013-05-21 19:58:38 UTC
For some reason, _increment_barcode is called twice in succession in cataloguing/additem.pl
Comment 1 Kyle M Hall 2013-05-21 20:00:36 UTC Comment hidden (obsolete)
Comment 2 Galen Charlton 2013-05-22 00:23:12 UTC
The patch itself looks OK, the patch title is clearly wrong.  Please update the patch title (and the bug title) to reflect the actual problem, which is that _increment_barcode is called twice.
Comment 3 Kyle M Hall 2013-08-09 13:25:26 UTC Comment hidden (obsolete)
Comment 4 Marcel de Rooy 2013-09-23 12:31:46 UTC
Created attachment 21370 [details] [review]
Bug 10305 - _increment_barcode is called twice

For some reason, _increment_barcode is called twice in succession in
cataloguing/additem.pl

Test Plan:
1) Enable autobarcode = incremental
2) Catalog an item, not the barcode
3) Apply this patch
4) Catalog another item, the barcode should be the next in line
   as previously. No change should be noted.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Marcel de Rooy 2013-09-23 12:37:26 UTC
Works. Looks good to me. There was no problem before, just a duplicate executing of a select max in the database.

Note that the code used for this increment might still be wrong with concurrent edits, since the max calculation and the update of the table are quite separate parts in code. Reminds me of the discussion about the seqno engine..

No complaints from qa tools.

Passed QA
Comment 6 Galen Charlton 2013-09-23 16:06:29 UTC
Pushed to master.  Thanks, Kyle!
Comment 7 Tomás Cohen Arazi 2013-11-13 16:23:31 UTC
This patch has been pushed to 3.12.x, will be in 3.12.7.

Thanks Kyle!