For some reason, _increment_barcode is called twice in succession in cataloguing/additem.pl
Created attachment 18281 [details] [review] Bug 10305 - Duplicate code in Search.pm 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.
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.
Created attachment 20227 [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.
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>
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
Pushed to master. Thanks, Kyle!
This patch has been pushed to 3.12.x, will be in 3.12.7. Thanks Kyle!