| Summary: | Deleting the last item in a label batch needs to redirect to ?op=new | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Phil Ringnalda <phil> |
| Component: | Label/patron card printing | Assignee: | Chris Nighswonger <cnighswonger> |
| Status: | NEW --- | QA Contact: | Testopia <testopia> |
| Severity: | normal | ||
| Priority: | P5 - low | CC: | dcook |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
|
Description
Phil Ringnalda
2024-06-28 18:27:10 UTC
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. |