[Bug 37223] New: Deleting the last item in a label batch needs to redirect to ?op=new
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37223 Bug ID: 37223 Summary: Deleting the last item in a label batch needs to redirect to ?op=new Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Label/patron card printing Assignee: cnighswonger@foundations.edu Reporter: phil@chetcolibrary.org QA Contact: testopia@bugs.koha-community.org When you delete the last item in a label batch, it effectively deletes the batch, but leaves you with an add form which still retains the batch_id. That means that if someone else creates a new batch before you add another item to "your" empty list, their batch will take that same batch_id, and when you add your item you will add it to their list. Steps to reproduce: 1. Cataloging - Label creator - New label batch 2. Add any item to the batch 3. In the list of items in the batch, click delete 4. Different browser, log in as a user at a different branch 5. Cataloging - Label creator - New label batch 6. Add any item to the batch 7. Back to the original browser, add any item to the "empty" batch 8. You now have a batch with two items in it when you only added one 9. Try to solve your confusion by going to Manage - label batches, maybe you added it to the wrong batch? Wups, no, there are no batches to manage, because now that batch you added an item to is owned by a different branch and you can't manage it to remove your accidental add. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37223 --- Comment #1 from Phil Ringnalda <phil@chetcolibrary.org> --- The unobvious thing behind "effectively deletes the batch" is that batches only exist by one or more items having a batch_id in the creator_batches table, where the primary key is label_id. C4::Labels::Batch->new sets batch_id to 0, and it stays that way until add_item is called, when batch_id is set to one more than SELECT MAX(batch_id) FROM creator_batches;. And deleting a batch consists of calling remove_item until they are all gone. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37223 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|major |normal CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org