[Bug 24289] New: Deleting branch will not delete entry in special holidays
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 Bug ID: 24289 Summary: Deleting branch will not delete entry in special holidays Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Database Assignee: koha-bugs@lists.koha-community.org Reporter: rocio@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org When you delete a branch that has holidays specified in special_holidays, these entries don't get deleted. To recreate: - add an calendar entry to Calendar for this branch - select * from special_holidays where branchcode = 'YOUR BRANCH'; - delete branch from Administration -> Libraries - select *.... holidays are still there for that branchcode -- 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=24289 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Blocks| |5334 Assignee|koha-bugs@lists.koha-commun |jonathan.druart@bugs.koha-c |ity.org |ommunity.org Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5334 [Bug 5334] Omnibus: Add explicit foreign key constraints -- 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=24289 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 96630 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96630&action=edit Bug 24289: Add foreign keys on *_holidays.branchcode tables Those are missing foreign keys, it will also clean the holidays tables and automatically remove the holidays when a library is removed. Test plan: 0. Do not apply this patch 1. Create a new library 2. Create special and repeatable holiday for this library 3. Remove the library => Notice that the holidays still exist in DB 4. Apply this patch 5. Execute the update database entry => Notice that the holidays for this library have been removed from the DB 6. Repeat 1-3 => Notice that the holidays have been removed along with the library -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 96631 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96631&action=edit Bug 24289: DBIC changes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 96632 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96632&action=edit Bug 24289: Make sure sample_holidays will load after sample_libraries They are inserted depending on their alpha order, and sample_holidays will fail because of missing branchcode. This patch suggests a simple fix: rename sample_holidays to sample_libraries_holidays, to make sure it will be loaded after sample_libraries Test plan: Start a fresh installation and select all sample data -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96630|0 |1 is obsolete| | Attachment #96631|0 |1 is obsolete| | Attachment #96632|0 |1 is obsolete| | --- Comment #4 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 97410 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97410&action=edit Bug 24289: Add foreign keys on *_holidays.branchcode tables Those are missing foreign keys, it will also clean the holidays tables and automatically remove the holidays when a library is removed. Test plan: 0. Do not apply this patch 1. Create a new library 2. Create special and repeatable holiday for this library 3. Remove the library => Notice that the holidays still exist in DB 4. Apply this patch 5. Execute the update database entry => Notice that the holidays for this library have been removed from the DB 6. Repeat 1-3 => Notice that the holidays have been removed along with the library -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 --- Comment #5 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 97411 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97411&action=edit Bug 24289: DBIC changes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 --- Comment #6 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 97412 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97412&action=edit Bug 24289: Make sure sample_holidays will load after sample_libraries They are inserted depending on their alpha order, and sample_holidays will fail because of missing branchcode. This patch suggests a simple fix: rename sample_holidays to sample_libraries_holidays, to make sure it will be loaded after sample_libraries Test plan: Start a fresh installation and select all sample data -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |baptiste.wojtkowski@biblibr | |e.com --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- *** Bug 18874 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Deleting branch will not |Deleting branch will not |delete entry in special |delete entry in special or |holidays |repeatable holidays CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 Katrin Fischer <katrin.fischer@bsz-bw.de> 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=24289 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #97410|0 |1 is obsolete| | --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 97600 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97600&action=edit Bug 24289: Add foreign keys on *_holidays.branchcode tables Those are missing foreign keys, it will also clean the holidays tables and automatically remove the holidays when a library is removed. Test plan: 0. Do not apply this patch 1. Create a new library 2. Create special and repeatable holiday for this library 3. Remove the library => Notice that the holidays still exist in DB 4. Apply this patch 5. Execute the update database entry => Notice that the holidays for this library have been removed from the DB 6. Repeat 1-3 => Notice that the holidays have been removed along with the library Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #97411|0 |1 is obsolete| | --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 97601 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97601&action=edit Bug 24289: DBIC changes Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #97412|0 |1 is obsolete| | --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 97602 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97602&action=edit Bug 24289: Make sure sample_holidays will load after sample_libraries They are inserted depending on their alpha order, and sample_holidays will fail because of missing branchcode. This patch suggests a simple fix: rename sample_holidays to sample_libraries_holidays, to make sure it will be loaded after sample_libraries Test plan: Start a fresh installation and select all sample data Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|Small patch |Medium patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.05.00 |20.05.00, 19.11.03 released in| | CC| |joy@bywatersolutions.com Status|Pushed to master |Pushed to stable --- Comment #12 from Joy Nelson <joy@bywatersolutions.com> --- Pushed to 19.11.x branch for 19.11.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.05.00, 19.11.03 |20.05.00, 19.11.03, released in| |19.05.08 CC| |lucas@bywatersolutions.com Status|Pushed to stable |Pushed to oldstable --- Comment #13 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 19.05.x for 19.05.08 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 Pablo AB <pablo.bianchi@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pablo.bianchi@gmail.com --- Comment #14 from Pablo AB <pablo.bianchi@gmail.com> --- On December I installed an instance based on koha stable without any issue. Today I get this error on web installer, while adding sample data. Seems related to this bug: sample_libraries_holidays.sql [Wed May 13 19:24:37 2020] install.pl: DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_mylibrary`.`repeatable_holidays`, CONSTRAINT `repeatable_holidays_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE) at /usr/share/perl5/DBIx/RunSQL.pm line 273. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Pablo AB from comment #14)
On December I installed an instance based on koha stable without any issue. Today I get this error on web installer, while adding sample data. Seems related to this bug:
sample_libraries_holidays.sql [Wed May 13 19:24:37 2020] install.pl: DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_mylibrary`.`repeatable_holidays`, CONSTRAINT `repeatable_holidays_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE) at /usr/share/perl5/DBIx/RunSQL.pm line 273.
Did you pick the sample libraries as well? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 --- Comment #16 from Pablo AB <pablo.bianchi@gmail.com> ---
Did you pick the sample libraries as well?
Probably not. I believe I just wanted to have some basic holidays set (for all branches) without adding the sample libraries. Now reading the sql filename I realize this might not be possible. Checkboxes have dependencies between each which are not validated? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24289 --- Comment #17 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- There is no validation (it should). The holidays tables have a foreign key on branches.branchcode, so you need the sample libraries as well. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org