| Summary: | circulation_rules are not deleted when accompanying issuingrules are deleted | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
| Component: | Circulation | Assignee: | Nick Clemens (kidclamp) <nick> |
| Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
| Severity: | critical | ||
| Priority: | P5 - low | CC: | gmcharlt, jonathan.druart, julian.maurice, kyle, m.de.rooy, martin.renvoize, tomascohen |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18928 | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Crowdfunding goal: | 0 |
| Patch complexity: | Small patch | Documentation contact: | |
| Documentation submission: | Text to go in the release notes: | ||
| Version(s) released in: |
19.05.00
|
Circulation function: | |
| Bug Depends on: | 18925 | ||
| Bug Blocks: | |||
| Attachments: |
Bug 22679: Delete related CirculationRules when Removing IssuingRule
Bug 22679: Delete related CirculationRules when Removing IssuingRule Bug 22679: Delete related CirculationRules when Removing IssuingRule |
||
Created attachment 88489 [details] [review] Bug 22679: Delete related CirculationRules when Removing IssuingRule Unfortunately, the tables here can't use a foreign key as one table uses null where the other uses '*' This patchset alters the delete method so delete related rules. It is somewhat of a workaround until all the columns in issuingrules are moved to circulation_rules To test: 1 - Add some issuing rules in koha, making sure to set maxissueqty 2 - Check the DB: SELECT * FROM circulation_rules; 3 - note some circulation rules were created 4 - Delete your rules via the staff interface 5 - Check the DB, the circulation rules remain 6 - Apply patch 7 - Repeat 8 - Huzzah! The rules delete! 9 - Prove the tests, read the code I think this is a good workaround. As we are removing issuingrules (I think Jonathan submitted patches to complete that already) I think we can live with this for a little. Created attachment 88529 [details] [review] Bug 22679: Delete related CirculationRules when Removing IssuingRule Unfortunately, the tables here can't use a foreign key as one table uses null where the other uses '*' This patchset alters the delete method so delete related rules. It is somewhat of a workaround until all the columns in issuingrules are moved to circulation_rules To test: 1 - Add some issuing rules in koha, making sure to set maxissueqty 2 - Check the DB: SELECT * FROM circulation_rules; 3 - note some circulation rules were created 4 - Delete your rules via the staff interface 5 - Check the DB, the circulation rules remain 6 - Apply patch 7 - Repeat 8 - Huzzah! The rules delete! 9 - Prove the tests, read the code Signed-off-by: Liz Rea <wizzyrea@gmail.com> Created attachment 88567 [details] [review] Bug 22679: Delete related CirculationRules when Removing IssuingRule Unfortunately, the tables here can't use a foreign key as one table uses null where the other uses '*' This patchset alters the delete method so delete related rules. It is somewhat of a workaround until all the columns in issuingrules are moved to circulation_rules To test: 1 - Add some issuing rules in koha, making sure to set maxissueqty 2 - Check the DB: SELECT * FROM circulation_rules; 3 - note some circulation rules were created 4 - Delete your rules via the staff interface 5 - Check the DB, the circulation rules remain 6 - Apply patch 7 - Repeat 8 - Huzzah! The rules delete! 9 - Prove the tests, read the code Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Awesome work all! Pushed to master for 19.05 Bug with enhancement not in 18.11.x series. See bug 18928 comment 37 for a follow-up on this, we should not delete all rules. We should delete in a transaction and handle the returned value. |
To recreate: 1 - Browse to Administration ->Circulation and fines 2 - Add a rule with a number for 'Total checkouts allowed' 3 - check the db: select * from circulation_rules 4 - The rule should be there 5 - Delete the rule from the staff interface 6 - Check the DB 7 - The rule is not deleted