[Bug 43876] New: CancelReceipt deletes items with raw SQL: no deleteditems copy, no reindex, no logging
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 Bug ID: 43876 Summary: CancelReceipt deletes items with raw SQL: no deleteditems copy, no reindex, no logging Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: adolfo.rodriguez@xercode.es QA Contact: testopia@bugs.koha-community.org Target Milestone: --- When a basket creates items on receiving (effective_create_items eq 'receiving'), cancelling a receipt (C4::Acquisition::CancelReceipt) deletes those items with a raw SQL DELETE in _cancel_items_receipt: DELETE FROM items, aqorders_items USING items, aqorders_items WHERE items.itemnumber = ? AND aqorders_items.itemnumber = ? Because Koha::Item->delete is bypassed: - no copy of the item is kept in deleteditems - the bibliographic record is not reindexed, so the deleted items are still shown in the search results (Elasticsearch and Zebra) - nothing is written to the cataloguing log - the after_item_action plugin hook (action 'delete') is not called - the real-time holds queue is not updated - an item group left empty is not deleted To reproduce: 1. Create a basket with "Create items when: receiving an order". 2. Add an order with quantity 2, close the basket and receive it. Two items are created and shown in the catalog search results. 3. Cancel the receipt. 4. The items are gone from the items table, but they are not in deleteditems, there is no DELETE entry in the cataloguing log, and the record still shows the items in the search results. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff --- Comment #1 from Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> --- Patch attached. The test plan is in the commit message. The items are still deleted without the safe_delete checks, as before; only the deletion mechanism changes. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 --- Comment #2 from Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> --- Created attachment 208631 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208631&action=edit Bug 43876: Use Koha::Item->delete when cancelling a receipt When the basket creates items on receiving, CancelReceipt deleted those items with a raw SQL DELETE in _cancel_items_receipt. This bypassed Koha::Item->delete, so: - no copy of the item was kept in deleteditems - the bibliographic record was not reindexed, so the deleted items were still shown in the search results - nothing was written to the cataloguing log - the after_item_action plugin hook was not called - the real-time holds queue was not updated - an item group left empty was not deleted This patch deletes each item with move_to_deleted and Koha::Item->delete, and removes the aqorders_items row explicitly (that table has no foreign key on items, so it is not cleaned up by the item deletion). The record is reindexed, and the holds queue updated, once after all the items have been deleted. As before, the items are deleted without checking whether they can be safely deleted (checkouts, holds...): only the deletion mechanism changes. Steps to follow: 1. Make sure the search index is updated automatically (koha-es-indexer running, or the Zebra daemon), and enable CataloguingLog. 2. Create a basket with "Create items when: receiving an order", add an order with quantity 2, close the basket and receive the order. Two items are created and are shown in the catalog search results. 3. Cancel the receipt. The items are gone from the record details page, but: - they are not in deleteditems: SELECT * FROM deleteditems WHERE biblionumber = <biblionumber>; - there is no DELETE entry for them in the cataloguing log (Tools > Log viewer > Cataloging) - the catalog search results still show the items 4. Apply the patch and restart Plack if running under it. 5. Repeat steps 2 and 3 with a new order. Now the items are moved to deleteditems, the cataloguing log shows a DELETE entry for each item, and the search results no longer show them. 6. Receive only 1 item of an order with quantity 2 (the order is split) and cancel that receipt: the item is moved to deleteditems and the original order is pending again with quantity 2. 7. With a basket that creates items on ordering, receive an order and cancel the receipt: the item is not deleted and is linked again to the pending order (no change in behaviour). 8. prove t/db_dependent/Acquisition/CancelReceipt.t Signed-off-by: Adolfo Rodríguez <adolfo.rodriguez@xercode.es> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #208631|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 --- Comment #3 from Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> --- Created attachment 208791 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208791&action=edit Bug 43876: Use Koha::Item->delete when cancelling a receipt When the basket creates items on receiving, CancelReceipt deleted those items with a raw SQL DELETE in _cancel_items_receipt. This bypassed Koha::Item->delete, so: - no copy of the item was kept in deleteditems - the bibliographic record was not reindexed, so the deleted items were still shown in the search results - nothing was written to the cataloguing log - the after_item_action plugin hook was not called - the real-time holds queue was not updated - an item group left empty was not deleted This patch deletes each item with move_to_deleted and Koha::Item->delete, and removes the aqorders_items row explicitly (that table has no foreign key on items, so it is not cleaned up by the item deletion). The record is reindexed, and the holds queue updated, once after all the items have been deleted. It also adds the missing POD for _cancel_items_receipt. As before, the items are deleted without checking whether they can be safely deleted (checkouts, holds...): only the deletion mechanism changes. Steps to follow: 1. Make sure the search index is updated automatically (koha-es-indexer running, or the Zebra daemon), and enable CataloguingLog. 2. Create a basket with "Create items when: receiving an order", add an order with quantity 2, close the basket and receive the order. Two items are created and are shown in the catalog search results. 3. Cancel the receipt. The items are gone from the record details page, but: - they are not in deleteditems: SELECT * FROM deleteditems WHERE biblionumber = <biblionumber>; - there is no DELETE entry for them in the cataloguing log (Tools > Log viewer > Cataloging) - the catalog search results still show the items 4. Apply the patch and restart Plack if running under it. 5. Repeat steps 2 and 3 with a new order. Now the items are moved to deleteditems, the cataloguing log shows a DELETE entry for each item, and the search results no longer show them. 6. Receive only 1 item of an order with quantity 2 (the order is split) and cancel that receipt: the item is moved to deleteditems and the original order is pending again with quantity 2. 7. With a basket that creates items on ordering, receive an order and cancel the receipt: the item is not deleted and is linked again to the pending order (no change in behaviour). 8. prove t/db_dependent/Acquisition/CancelReceipt.t Signed-off-by: Adolfo Rodríguez <adolfo.rodriguez@xercode.es> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #208791|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 208910 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208910&action=edit Bug 43876: Use Koha::Item->delete when cancelling a receipt When the basket creates items on receiving, CancelReceipt deleted those items with a raw SQL DELETE in _cancel_items_receipt. This bypassed Koha::Item->delete, so: - no copy of the item was kept in deleteditems - the bibliographic record was not reindexed, so the deleted items were still shown in the search results - nothing was written to the cataloguing log - the after_item_action plugin hook was not called - the real-time holds queue was not updated - an item group left empty was not deleted This patch deletes each item with move_to_deleted and Koha::Item->delete, and removes the aqorders_items row explicitly (that table has no foreign key on items, so it is not cleaned up by the item deletion). The record is reindexed, and the holds queue updated, once after all the items have been deleted. It also adds the missing POD for _cancel_items_receipt. As before, the items are deleted without checking whether they can be safely deleted (checkouts, holds...): only the deletion mechanism changes. Steps to follow: 1. Make sure the search index is updated automatically (koha-es-indexer running, or the Zebra daemon), and enable CataloguingLog. 2. Create a basket with "Create items when: receiving an order", add an order with quantity 2, close the basket and receive the order. Two items are created and are shown in the catalog search results. 3. Cancel the receipt. The items are gone from the record details page, but: - they are not in deleteditems: SELECT * FROM deleteditems WHERE biblionumber = <biblionumber>; - there is no DELETE entry for them in the cataloguing log (Tools > Log viewer > Cataloging) - the catalog search results still show the items 4. Apply the patch and restart Plack if running under it. 5. Repeat steps 2 and 3 with a new order. Now the items are moved to deleteditems, the cataloguing log shows a DELETE entry for each item, and the search results no longer show them. 6. Receive only 1 item of an order with quantity 2 (the order is split) and cancel that receipt: the item is moved to deleteditems and the original order is pending again with quantity 2. 7. With a basket that creates items on ordering, receive an order and cancel the receipt: the item is not deleted and is linked again to the pending order (no change in behaviour). 8. prove t/db_dependent/Acquisition/CancelReceipt.t Signed-off-by: Adolfo Rodríguez <adolfo.rodriguez@xercode.es> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |adolfo.rodriguez@xercode.es |ity.org | CC| |david@davidnind.com Keywords| |release-notes-needed --- Comment #5 from David Nind <david@davidnind.com> --- Added assignee 8-). -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am not sure if this is actually a bug or not by design. An item that is deleted before it was received in the library or was falsely received never actually "existed" as part of the collection. That means that by adding it to the deleteditems table, it will possibly interfere with statistics on weeded items. Maybe they could be a way to mark them as temporary item records that would help us to exclude them from statistics? I can see that using the normal delete is the easiest way to fix the other issues, but maybe there is an easy compromise to be found. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Katrin Fischer from comment #6)
I am not sure if this is actually a bug or not by design. An item that is deleted before it was received in the library or was falsely received never actually "existed" as part of the collection. That means that by adding it to the deleteditems table, it will possibly interfere with statistics on weeded items.
Maybe they could be a way to mark them as temporary item records that would help us to exclude them from statistics?
I can see that using the normal delete is the easiest way to fix the other issues, but maybe there is an easy compromise to be found.
Maybe to explain a bit more: libraries here need to keep track of items they buy and weed pretty closely. So we try to have this information reliably in Koha for an electronic inventory book, replacing printed ones. I am aware the false item count might not be huge, but it could create an issue. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 --- Comment #8 from Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> --- Created attachment 208951 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208951&action=edit Bug 43876: (follow-up) Do not copy the cancelled items to deleteditems Items created on receiving and deleted when the receipt is cancelled were never part of the collection. Copying them to deleteditems would count them as weeded items in the statistics, and libraries use that data as an inventory book (see comment 6). Koha::Item->delete does not copy the item to deleteditems by itself, so this follow-up just removes the move_to_deleted call. The rest of the fix is kept: the record is reindexed, the deletion is logged, the plugin hooks are called, the holds queue is updated and an empty item group is deleted. Steps to follow: 1. Apply both patches. 2. Follow the steps of the first patch, except that after cancelling the receipt the items must NOT be in deleteditems: SELECT * FROM deleteditems WHERE biblionumber = <biblionumber>; returns no rows. 3. The items are still removed from the search results, and there is a DELETE entry for them in the cataloguing log (if CataloguingLog is enabled). 4. prove t/db_dependent/Acquisition/CancelReceipt.t Signed-off-by: Adolfo Rodríguez <adolfo.rodriguez@xercode.es> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 --- Comment #9 from Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> --- Thanks Katrin, that's a good point: the items whose receipt is cancelled never were part of the collection, so they should not be counted as weeded items. Koha::Item->delete does not copy the item to deleteditems by itself (that is done by a separate move_to_deleted call), so I've added a follow-up that just removes that call. The items are deleted as before and the rest of the fix is kept: the record is reindexed, the deletion is logged, the plugin hooks are called, the holds queue is updated and an empty item group is deleted. The follow-up needs a signoff, so I'm setting the bug back to Needs Signoff. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |When cancelling the receipt release notes| |of an order whose basket | |creates items on receiving, | |the items are now deleted | |the same way as other item | |deletions: the | |bibliographic record is | |reindexed (so the items are | |no longer shown in the | |search results), the | |deletion is recorded in the | |cataloguing log, plugin | |hooks are called, the holds | |queue is updated and empty | |item groups are deleted. As | |before, the items are not | |copied to the deleted items | |table, as they never were | |part of the collection. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #208910|0 |1 is obsolete| | Attachment #208951|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 --- Comment #10 from David Nind <david@davidnind.com> --- Created attachment 209237 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209237&action=edit Bug 43876: Use Koha::Item->delete when cancelling a receipt When the basket creates items on receiving, CancelReceipt deleted those items with a raw SQL DELETE in _cancel_items_receipt. This bypassed Koha::Item->delete, so: - no copy of the item was kept in deleteditems - the bibliographic record was not reindexed, so the deleted items were still shown in the search results - nothing was written to the cataloguing log - the after_item_action plugin hook was not called - the real-time holds queue was not updated - an item group left empty was not deleted This patch deletes each item with move_to_deleted and Koha::Item->delete, and removes the aqorders_items row explicitly (that table has no foreign key on items, so it is not cleaned up by the item deletion). The record is reindexed, and the holds queue updated, once after all the items have been deleted. It also adds the missing POD for _cancel_items_receipt. As before, the items are deleted without checking whether they can be safely deleted (checkouts, holds...): only the deletion mechanism changes. Steps to follow: 1. Make sure the search index is updated automatically (koha-es-indexer running, or the Zebra daemon), and enable CataloguingLog. 2. Create a basket with "Create items when: receiving an order", add an order with quantity 2, close the basket and receive the order. Two items are created and are shown in the catalog search results. 3. Cancel the receipt. The items are gone from the record details page, but: - they are not in deleteditems: SELECT * FROM deleteditems WHERE biblionumber = <biblionumber>; - there is no DELETE entry for them in the cataloguing log (Tools > Log viewer > Cataloging) - the catalog search results still show the items 4. Apply the patch and restart Plack if running under it. 5. Repeat steps 2 and 3 with a new order. Now the items are moved to deleteditems, the cataloguing log shows a DELETE entry for each item, and the search results no longer show them. 6. Receive only 1 item of an order with quantity 2 (the order is split) and cancel that receipt: the item is moved to deleteditems and the original order is pending again with quantity 2. 7. With a basket that creates items on ordering, receive an order and cancel the receipt: the item is not deleted and is linked again to the pending order (no change in behaviour). 8. prove t/db_dependent/Acquisition/CancelReceipt.t Signed-off-by: Adolfo Rodríguez <adolfo.rodriguez@xercode.es> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 --- Comment #11 from David Nind <david@davidnind.com> --- Created attachment 209238 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209238&action=edit Bug 43876: (follow-up) Do not copy the cancelled items to deleteditems Items created on receiving and deleted when the receipt is cancelled were never part of the collection. Copying them to deleteditems would count them as weeded items in the statistics, and libraries use that data as an inventory book (see comment 6). Koha::Item->delete does not copy the item to deleteditems by itself, so this follow-up just removes the move_to_deleted call. The rest of the fix is kept: the record is reindexed, the deletion is logged, the plugin hooks are called, the holds queue is updated and an empty item group is deleted. Steps to follow: 1. Apply both patches. 2. Follow the steps of the first patch, except that after cancelling the receipt the items must NOT be in deleteditems: SELECT * FROM deleteditems WHERE biblionumber = <biblionumber>; returns no rows. 3. The items are still removed from the search results, and there is a DELETE entry for them in the cataloguing log (if CataloguingLog is enabled). 4. prove t/db_dependent/Acquisition/CancelReceipt.t Signed-off-by: Adolfo Rodríguez <adolfo.rodriguez@xercode.es> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arthur.suzuki@biblibre.com QA Contact|testopia@bugs.koha-communit |arthur.suzuki@biblibre.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #209237|0 |1 is obsolete| | Attachment #209238|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 --- Comment #12 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Created attachment 209394 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209394&action=edit Bug 43876: Use Koha::Item->delete when cancelling a receipt When the basket creates items on receiving, CancelReceipt deleted those items with a raw SQL DELETE in _cancel_items_receipt. This bypassed Koha::Item->delete, so: - no copy of the item was kept in deleteditems - the bibliographic record was not reindexed, so the deleted items were still shown in the search results - nothing was written to the cataloguing log - the after_item_action plugin hook was not called - the real-time holds queue was not updated - an item group left empty was not deleted This patch deletes each item with move_to_deleted and Koha::Item->delete, and removes the aqorders_items row explicitly (that table has no foreign key on items, so it is not cleaned up by the item deletion). The record is reindexed, and the holds queue updated, once after all the items have been deleted. It also adds the missing POD for _cancel_items_receipt. As before, the items are deleted without checking whether they can be safely deleted (checkouts, holds...): only the deletion mechanism changes. Steps to follow: 1. Make sure the search index is updated automatically (koha-es-indexer running, or the Zebra daemon), and enable CataloguingLog. 2. Create a basket with "Create items when: receiving an order", add an order with quantity 2, close the basket and receive the order. Two items are created and are shown in the catalog search results. 3. Cancel the receipt. The items are gone from the record details page, but: - they are not in deleteditems: SELECT * FROM deleteditems WHERE biblionumber = <biblionumber>; - there is no DELETE entry for them in the cataloguing log (Tools > Log viewer > Cataloging) - the catalog search results still show the items 4. Apply the patch and restart Plack if running under it. 5. Repeat steps 2 and 3 with a new order. Now the items are moved to deleteditems, the cataloguing log shows a DELETE entry for each item, and the search results no longer show them. 6. Receive only 1 item of an order with quantity 2 (the order is split) and cancel that receipt: the item is moved to deleteditems and the original order is pending again with quantity 2. 7. With a basket that creates items on ordering, receive an order and cancel the receipt: the item is not deleted and is linked again to the pending order (no change in behaviour). 8. prove t/db_dependent/Acquisition/CancelReceipt.t Signed-off-by: Adolfo Rodríguez <adolfo.rodriguez@xercode.es> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 --- Comment #13 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Created attachment 209395 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209395&action=edit Bug 43876: (follow-up) Do not copy the cancelled items to deleteditems Items created on receiving and deleted when the receipt is cancelled were never part of the collection. Copying them to deleteditems would count them as weeded items in the statistics, and libraries use that data as an inventory book (see comment 6). Koha::Item->delete does not copy the item to deleteditems by itself, so this follow-up just removes the move_to_deleted call. The rest of the fix is kept: the record is reindexed, the deletion is logged, the plugin hooks are called, the holds queue is updated and an empty item group is deleted. Steps to follow: 1. Apply both patches. 2. Follow the steps of the first patch, except that after cancelling the receipt the items must NOT be in deleteditems: SELECT * FROM deleteditems WHERE biblionumber = <biblionumber>; returns no rows. 3. The items are still removed from the search results, and there is a DELETE entry for them in the cataloguing log (if CataloguingLog is enabled). 4. prove t/db_dependent/Acquisition/CancelReceipt.t Signed-off-by: Adolfo Rodríguez <adolfo.rodriguez@xercode.es> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 --- Comment #14 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Works as expected, QA scripts happy, and as far as I can tell, all coding guidelines and style are respected, QA passes for me. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Adolfo Rodríguez Taboada from comment #9)
Thanks Katrin, that's a good point: the items whose receipt is cancelled never were part of the collection, so they should not be counted as weeded items.
Koha::Item->delete does not copy the item to deleteditems by itself (that is done by a separate move_to_deleted call), so I've added a follow-up that just removes that call. The items are deleted as before and the rest of the fix is kept: the record is reindexed, the deletion is logged, the plugin hooks are called, the holds queue is updated and an empty item group is deleted.
The follow-up needs a signoff, so I'm setting the bug back to Needs Signoff.
Thanks Adolfo, that sounds like the perfect solution :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 --- Comment #16 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43876 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|CancelReceipt deletes items |CancelReceipt deletes items |with raw SQL: no |with raw SQL: no reindex, |deleteditems copy, no |no logging |reindex, no logging | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org