[Bug 22275] New: 18.06.00.060 DB update fails (incomplete/incorrect defaults)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 Bug ID: 22275 Summary: 18.06.00.060 DB update fails (incomplete/incorrect defaults) Change sponsored?: --- Product: Koha Version: 18.11 Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Label/patron card printing Assignee: cnighswonger@foundations.edu Reporter: oliver.behnke@aei.mpg.de QA Contact: testopia@bugs.koha-community.org Target Milestone: --- The DB schema changes in https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=82289 are incomplete/incorrect. 1) Table "class_sources" gets its "class_split_rule" pre-filled with all existing "class_sort_rule" counterparts, yet the "class_split_rules" table is only filled with fixed presets. Thus adding the "class_source_ibfk_2" constraint will fail as soon as there are more sort rules than split rules, that is, as soon as there are any custom sort rules. 2) The "class_split_rules" preset values are apparently copied from the "class_sort_rules" rules, leaving the "sorting rules" fragment in their descriptions. Those are presumably meant to be called "splitting rules". Best, Oliver -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 Oliver Behnke <oliver.behnke@aei.mpg.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |15836 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15836 [Bug 15836] Labels: Offer configuration option for splitting call numbers -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de, | |nick@bywatersolutions.com Assignee|cnighswonger@foundations.ed |jonathan.druart@bugs.koha-c |u |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Oliver, thx for the bug! 1) Table "class_sources" gets its "class_split_rule" pre-filled with all existing "class_sort_rule" counterparts, yet the "class_split_rules" table is only filled with fixed presets. Thus adding the "class_source_ibfk_2" constraint will fail as soon as there are more sort rules than split rules, that is, as soon as there are any custom sort rules. I assume you added the custom sort rules yourself. I've not done that before. What did it involve? Just adding the file in the right directory?
2) The "class_split_rules" preset values are apparently copied from the "class_sort_rules" rules, leaving the "sorting rules" fragment in their descriptions. Those are presumably meant to be called "splitting rules".
Would it be possible for you to share a screenshot of your classification sources page with the 3 tables? I think it would be helpful to understand the issue. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 --- Comment #2 from Oliver Behnke <oliver.behnke@aei.mpg.de> --- Hi Katrin,
I assume you added the custom sort rules yourself. I've not done that before. What did it involve? Just adding the file in the right directory?
That's just an administrative action at "Administration > Catalog > Classification sources". Since we're using MCS/PACS classification we simply added a custom entries (source and filing/sorting rule) when we set up Koha. To be honest, I have no idea what the actual effect of these settings/rules is, aside from describing things. But since adding custom filing/sorting rules is clearly a normal administrative task the DB update procedure must take that into account.
I think it would be helpful to understand the issue.
It's just about a potential misnomer: I was referring to the fact that the table holds "Classification **splitting** rules" yet the records' description always says "**sorting** rules", eg. "Default sorting rules for DDC" in case of Dewey. That seemed like a copy 'n' paste error, as it should probably read "Default **splitting** rules for DDC" in this example. That was just an informed guess. Ignore me here if my assumptions are wrong. Cheers -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I think I get it now - you mean you added a custom classification source and filing rule. I was thinking of a custom filing routine that is set in the filing rule (which wasn't changed/added to, right?) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 --- Comment #4 from Oliver Behnke <oliver.behnke@aei.mpg.de> --- Correct, all our custom *rules* use the pre-defined "Generic" *routines*. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Can you post a step-by-step plan to recreate the issue? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 --- Comment #6 from Oliver Behnke <oliver.behnke@aei.mpg.de> --- Hi Jonathan, please see 1) in my first post: - take a pre 18.06.00.060 instance (DB schema) - add a custom sort rule at "Administration > Catalog > Classification sources" - run the 18.06.00.060 DB update Hope that helps, Oliver -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|18.11 |master Status|NEW |Needs Signoff --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- We will need a new update DB entry for 18.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 85772 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=85772&action=edit Bug 22275: (bug 15836 follow-up) Fix class_sources.class_split_rule FK creation 18.06.00.060 will fail if custom Classification sources were created. In that case we should use the 'generic' split rule. Test plan: % git checkout -b bug_22395_pre 3a0cba67f1387595f570ab9d9efdeabc856345b4 Reset the DB Go to Home › Administration › Classification sources Create a custom "Classification filing rules" Create a custom "Classification sources" using this filing rules % git checkout master % perl installer/data/mysql/updatedatabase.pl => Without this patch you will get: DBD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`#sql-33a_67`, CONSTRAINT `class_source_ibfk_2` FOREIGN KEY (`class_split_rule`) REFERENCES `class_split _rules` (`class_split_rule`)) [for Statement " ALTER TABLE class_sources ADD CONSTRAINT class_source_ibfk_2 FOREIGN KEY (class_split_rule) REFERENCES class_split_rules (class_split_rule) "] at installer/data/mysql/updatedatabase.pl line 17104. => With this patch applied the FK will be created successfully class_sources.class_split_rule will be set to "generic" for these custom values. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 --- Comment #9 from Oliver Behnke <oliver.behnke@aei.mpg.de> --- Looking at the proposed patch, how can resetting custom values be a solution to the problem? What's worse: users running the DB update won't even notice their settings got silently reset in the background. If users aren't meant to use custom values, why are those (sources, sorting and filing rules) fully editable in the first place? Cheers -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 --- Comment #10 from Oliver Behnke <oliver.behnke@aei.mpg.de> --- Please ignore my previous comment as I indeed was confused :) I sign off on the patch. Cheers -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Oliver Behnke from comment #10)
Please ignore my previous comment as I indeed was confused :) I sign off on the patch.
Cheers
Please switch to 'signed off' when signing off and add your sign-off to the patch. One way to do this is through the sandboxes: https://wiki.koha-community.org/wiki/Sandboxes Please let me know if you need help with that! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 Oliver Behnke <oliver.behnke@aei.mpg.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #12 from Oliver Behnke <oliver.behnke@aei.mpg.de> --- I wasn't sure if I'm supposed to act as the gatekeeper here :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 --- Comment #13 from Oliver Behnke <oliver.behnke@aei.mpg.de> --- FYI, I'm going to sign-off via a sandbox as well, as soon as I got one set up to test this patch for real... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 sandboxes@biblibre.com <sandboxes@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sandboxes@biblibre.com --- Comment #14 from sandboxes@biblibre.com <sandboxes@biblibre.com> --- Patch tested with a sandbox, by Oliver Behnke <oliver.behnke@aei.mpg.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 --- Comment #15 from Oliver Behnke <oliver.behnke@aei.mpg.de> --- FYI, I couldn't coerce any sandbox into first deploying a pre-15836 database, then provide manually the necessary test and finally apply the path without further DB changes. Anyhow, I double checked the patch itself so my sign-off still holds. Cheers -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 Josef Moravec <josef.moravec@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=22275 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #85772|0 |1 is obsolete| | --- Comment #16 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 86048 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86048&action=edit Bug 22275: (bug 15836 follow-up) Fix class_sources.class_split_rule FK creation 18.06.00.060 will fail if custom Classification sources were created. In that case we should use the 'generic' split rule. Test plan: % git checkout -b bug_22395_pre 3a0cba67f1387595f570ab9d9efdeabc856345b4 Reset the DB Go to Home › Administration › Classification sources Create a custom "Classification filing rules" Create a custom "Classification sources" using this filing rules % git checkout master % perl installer/data/mysql/updatedatabase.pl => Without this patch you will get: DBD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`#sql-33a_67`, CONSTRAINT `class_source_ibfk_2` FOREIGN KEY (`class_split_rule`) REFERENCES `class_split _rules` (`class_split_rule`)) [for Statement " ALTER TABLE class_sources ADD CONSTRAINT class_source_ibfk_2 FOREIGN KEY (class_split_rule) REFERENCES class_split_rules (class_split_rule) "] at installer/data/mysql/updatedatabase.pl line 17104. => With this patch applied the FK will be created successfully class_sources.class_split_rule will be set to "generic" for these custom values. Signed-off-by: Oliver Behnke <oliver.behnke@aei.mpg.de> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |josef.moravec@gmail.com |y.org | CC| |josef.moravec@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #17 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 19.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 --- Comment #18 from Oliver Behnke <oliver.behnke@aei.mpg.de> --- Just to make sure: is this going to be pushed to 18.11 as well? I think it has to be. Thanks everyone! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 --- Comment #19 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Oliver Behnke from comment #18)
Just to make sure: is this going to be pushed to 18.11 as well? I think it has to be.
Thanks everyone!
RMaints have the final decision, but since this is marked as a major bug and appears int he older versions, this will be considered (all bugs usually are, while enhancements are not). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Pushed to Master |Pushed to Stable --- Comment #20 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Pushed to 18.11.x for 18.11.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #21 from Lucas Gass <lucas@bywatersolutions.com> --- missing 15836 dependency, not backporting to 18.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22275 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Stable |RESOLVED Resolution|--- |FIXED CC| |fridolin.somers@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org