Description
Nick Clemens (kidclamp)
2014-09-11 19:04:01 UTC
*** Bug 8042 has been marked as a duplicate of this bug. *** Created attachment 35600 [details] [review] Bug 12911 - batch_id for new label batches can be assigned to several batches -Added code to make a placeholder and thus reserve the batch number. -Added code to delete old placeholders everytime a new batch is made. -Modified code in SELECT query to disc Testing Plan -Open two koha staff windows in different browsers/inprivate. -On both navigate Home>Tools>Label Creator -Make a new batch in the first window -Make a new batch in the second window *The new batches created should have different batch numbers -Add items to one of the batches *Only the items added should show in the summary below. No placeholders should be shown -Go back to manage batches page on either window *The batch created which did not have any items added to it should not be displayed in this window I tried testing and got odd results with one number displaying as batch id, but the results saving into the DB with a higher batch id, I suspect there is some double increment due to the placeholder records. I am wondering if instead of adding a placeholder at object creation the batch id could be assigned after the first items are added? Maybe assign batch ID -1, don't display it in the add screen, and then in the add items function check for batch id -1 and create the new items then? Created attachment 35719 [details] [review] Bug 12911 - batch_id for new labels batches can be asssigned to several batches Currently batch_id is assigned upon creation of a new batch object. This patch leaves batch_id as 0 at creation and adds a check when adding items. If batch is new then batch_id is created then Test plan: 1 -In one browser window, go to tools->label creator and click the new batch button 2 - Before adding items, open a new browser, and go tools->label creator and click the new batch button 3 - Note that both batches have the same number listed 4 - Add an item to the first batch - you should now see one item in the batch 5 - Add an item to the second batch, you should see two items in the batch 6 - Apply patch and repeat steps 1&2 7 - Note that neither batch lists a batch number 8 - Add an item to the first batch, you should see one item and a batch number 9 - Add an item to the second batch, you should see one item and a new batch number Created attachment 35807 [details] [review] [Signed-off] Bug 12911 - batch_id for new labels batches can be asssigned to several batches Currently batch_id is assigned upon creation of a new batch object. This patch leaves batch_id as 0 at creation and adds a check when adding items. If batch is new then batch_id is created then Test plan: 1 -In one browser window, go to tools->label creator and click the new batch button 2 - Before adding items, open a new browser, and go tools->label creator and click the new batch button 3 - Note that both batches have the same number listed 4 - Add an item to the first batch - you should now see one item in the batch 5 - Add an item to the second batch, you should see two items in the batch 6 - Apply patch and repeat steps 1&2 7 - Note that neither batch lists a batch number 8 - Add an item to the first batch, you should see one item and a batch number 9 - Add an item to the second batch, you should see one item and a new batch number Patch behaves as expected. Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 35898 [details] [review] [PASSED QA] Bug 12911 - batch_id for new labels batches can be asssigned to several batches Currently batch_id is assigned upon creation of a new batch object. This patch leaves batch_id as 0 at creation and adds a check when adding items. If batch is new then batch_id is created then Test plan: 1 -In one browser window, go to tools->label creator and click the new batch button 2 - Before adding items, open a new browser, and go tools->label creator and click the new batch button 3 - Note that both batches have the same number listed 4 - Add an item to the first batch - you should now see one item in the batch 5 - Add an item to the second batch, you should see two items in the batch 6 - Apply patch and repeat steps 1&2 7 - Note that neither batch lists a batch number 8 - Add an item to the first batch, you should see one item and a batch number 9 - Add an item to the second batch, you should see one item and a new batch number Patch behaves as expected. Signed-off-by: Marc Veron <veron@veron.ch> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Patch pushed to master. Thanks Nick! Pushed to 3.18.x will be in 3.18.7 > Test plan: > 1 -In one browser window, go to tools->label creator and click the new batch > button > 2 - Before adding items, open a new browser, and go tools->label creator and > click the new batch button > 3 - Note that both batches have the same number listed > 4 - Add an item to the first batch - you should now see one item in the batch > 5 - Add an item to the second batch, you should see two items in the batch > 6 - Apply patch and repeat steps 1&2 > 7 - Note that neither batch lists a batch number > 8 - Add an item to the first batch, you should see one item and a batch > number > 9 - Add an item to the second batch, you should see one item and a new batch > number But does not work if you add a second item! See bug 14739 and please provide a quick fix. This bug is much more annoying than the one fixed by this patch. |