[Bug 30451] New: Delete a subscription delete the linked order
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451 Bug ID: 30451 Summary: Delete a subscription delete the linked order Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Serials Assignee: koha-bugs@lists.koha-community.org Reporter: severine.queune@bulac.fr QA Contact: testopia@bugs.koha-community.org Several issues happened when you delete a subscription linked to an order : - the warning message doesn't mentioned an existing order - the deletion of the subscription deleted the order too. That's annoying... I think the deletion should only empty the aqorder.subscriptionid datafield. -- 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=30451 --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- +1 The least would be a warning, but I also think it should just 'unlink' the subscription from the order. -- 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=30451 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Delete a subscription |Delete a subscription |delete the linked order |deletes the linked order --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I'd like to give this another push, the current behaviour means that we are losing data that is still needed in acq. -- 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=30451 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|major |blocker --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This is a major data loss issue, upgrading severity. The problem is, that the budgets and fund values will be wrong for the current and past years. Sums don't add up etc. We just had a library that deleted 2 print serials that have now been bought as electronic versions. All data old data, subscriptions and acquisition data was lost when the record was deleted. -- 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=30451 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- DROP TABLE IF EXISTS `aqorders`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `aqorders` ( `ordernumber` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key and unique identifier assigned by Koha to each line', `biblionumber` int(11) DEFAULT NULL COMMENT 'links the order to the biblio being ordered (biblio.biblionumber)', `deleted_biblionumber` int(11) DEFAULT NULL COMMENT 'links the order to the deleted bibliographic record (deletedbiblio.biblionumber)', `entrydate` date DEFAULT NULL COMMENT 'the date the bib was added to the basket', [...] CONSTRAINT `aqorders_invoice_currency` FOREIGN KEY (`invoice_currency`) REFERENCES `currency` (`currency`) ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT `aqorders_subscriptionid` FOREIGN KEY (`subscriptionid`) REFERENCES `subscription` (`subscriptionid`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; The constraint needs to be updated to be: ON DELETE SET NULL -- 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=30451 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michaela.sieber@kit.edu -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com Depends on| |5343 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5343 [Bug 5343] Subscription cost (Link serial and acqui modules) -- 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=30451 --- Comment #5 from Michaela Sieber <michaela.sieber@kit.edu> --- +1 -- 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=30451 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |katrin.fischer@bsz-bw.de |ity.org | -- 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=30451 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 153799 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153799&action=edit Bug 30451: Update FK constraint on aqorders.subscriptionid This updates the FK constrant from ON DELETE CASCADE to ON DELETE SET NULL. This means that if a subscription linked to an order is deleted, we no longer will also delete the order, but we will just set subscrptinid in the order to NULL. This will avoid data loss that can cause the budgets/funds not to add up anymore with the real espenses of the library. To test: Preparation: * Create 2 subscriptions on different records * Create a new basket * Use the "order from subscription" functionality to create order lines for both of your subscriptions * Close basket Without patch: * Delete the first subscription * Verify the order line for this subscription is gone from your basket Apply patch: * Run database update and restart_all * Delete the second subscription * Verify the order line now remained in the basket -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451 Biblibre Sandboxes <sandboxes@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153799|0 |1 is obsolete| | --- Comment #7 from Biblibre Sandboxes <sandboxes@biblibre.com> --- Created attachment 153818 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153818&action=edit Bug 30451: Update FK constraint on aqorders.subscriptionid This updates the FK constrant from ON DELETE CASCADE to ON DELETE SET NULL. This means that if a subscription linked to an order is deleted, we no longer will also delete the order, but we will just set subscrptinid in the order to NULL. This will avoid data loss that can cause the budgets/funds not to add up anymore with the real espenses of the library. To test: Preparation: * Create 2 subscriptions on different records * Create a new basket * Use the "order from subscription" functionality to create order lines for both of your subscriptions * Close basket Without patch: * Delete the first subscription * Verify the order line for this subscription is gone from your basket Apply patch: * Run database update and restart_all * Delete the second subscription * Verify the order line now remained in the basket Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451 Michaela Sieber <michaela.sieber@kit.edu> 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=30451 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=30451 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153818|0 |1 is obsolete| | --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 153966 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153966&action=edit Bug 30451: Update FK constraint on aqorders.subscriptionid This updates the FK constrant from ON DELETE CASCADE to ON DELETE SET NULL. This means that if a subscription linked to an order is deleted, we no longer will also delete the order, but we will just set subscrptinid in the order to NULL. This will avoid data loss that can cause the budgets/funds not to add up anymore with the real espenses of the library. To test: Preparation: * Create 2 subscriptions on different records * Create a new basket * Use the "order from subscription" functionality to create order lines for both of your subscriptions * Close basket Without patch: * Delete the first subscription * Verify the order line for this subscription is gone from your basket Apply patch: * Run database update and restart_all * Delete the second subscription * Verify the order line now remained in the basket Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> JD amended patch: perl tidy Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451 --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- I would not consider this a blocker, this is an historical behavior. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Jonathan Druart from comment #9)
I would not consider this a blocker, this is an historical behavior.
Historical yes, but we defined blocker by data loss and that's what it does. And I think rather unexpectedly, just often hard to detect right away. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed CC| |fridolin.somers@biblibre.co | |m Status|Pushed to master |Pushed to stable Version(s)|23.11.00 |23.11.00,23.05.03 released in| | --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.05.x for 23.05.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.11.00,23.05.03 |23.11.00,23.05.03,22.11.09 released in| | Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451 --- Comment #13 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Nice work everyone! Pushed to 22.11.x for next release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451 --- Comment #14 from Fridolin Somers <fridolin.somers@biblibre.com> --- Ah recent push to master : 9bb23b7d5e Bug 30451: DBIC schema Pushed to 23.05.x for 23.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |When an order had been release notes| |created using the 'from a | |subscription' option and | |the subscription was | |deleted, the order line | |would be deleted with it, | |independent of its status | |or age. This caused | |problems with funds and | |budgets. With this patch, | |we will unlink order line | |and subscription on delete, | |but the order line will | |remain. Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matt.blenkinsop@ptfs-europe | |.com --- Comment #15 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Follow-up patch also backported to 22.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org