[Bug 20280] New: Authorised value categories list in bibliographic frameworks has 2 empty entries
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20280 Bug ID: 20280 Summary: Authorised value categories list in bibliographic frameworks has 2 empty entries Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: System Administration Assignee: koha-bugs@lists.koha-community.org Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com To test: - Edit a subfield in any of your bibliographic frameworks - In the last section, take a look at the authorised value categories list - Confirm there are 2 empty entries Tested with sample data. -- 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=20280 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |trivial -- 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=20280 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- installer/data/mysql/mandatory/auth_val_cat.sql: 1 INSERT IGNORE INTO authorised_value_categories( category_name ) 2 VALUES 3 (''), but installer/data/mysql/updatedatabase.pl: 13164 INSERT IGNORE INTO authorised_value_categories( category_name ) 13165 VALUES 13166 ('Asort1'), "" is missing Moreover: commit 62aa3f4292d83bc9304e296de5f0830e28510492 Bug 17216: Use Koha::AVC from mss.pl Added this additional blank entry in the template: + <option value=""></option> Additional info, in admin/authorised_values.pl we have: 215 my @categories = Koha::AuthorisedValueCategories->search({ category_name => { -not_in => ['', 'branches', 'itemtypes', 'cn_source']}}, { order_by => ['category_name'] } ); So maybe a solution could be to: - remove all the additional entries in template (if there are others than in admin/marc_subfields_structure.tt) - the add the AV category "" to existing install (unless it already exists) -- 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=20280 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|trivial |minor -- 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=20280 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Sorry Jonathan, not sure I understand. I think there should be no empty entry in our db table, but not sure why it was added in the first place. -- 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=20280 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Katrin Fischer from comment #2)
Sorry Jonathan, not sure I understand. I think there should be no empty entry in our db table, but not sure why it was added in the first place.
from auth_val_cat.sql? -- 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=20280 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Jonathan Druart from comment #3)
(In reply to Katrin Fischer from comment #2)
Sorry Jonathan, not sure I understand. I think there should be no empty entry in our db table, but not sure why it was added in the first place.
from auth_val_cat.sql?
I saw that, but why is it there? :) -- 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=20280 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- So, weird history. On bug 17216 (which created the authorised_value_categories table), there is one commit adding the empty option in the template: + <option value=""></option> (Bug 17216: Use Koha::AVC from mss.pl) Then one commit hiding the empty value from the DB: Bug 17216: Do no display the empty string category name And finally the last commit (Bug 17216: Move the AV cat list file to the top level) changed the name of .sql installer file and add the empty entry in the DB (nothing in the commit description or the bug report tells something about that change). Also, another occurrence is in auth_subfields_structure.pl where the empty entry comes from the DB. Prior to 17216 the empty option was added once from the .pl and once from the .tt (not consistent but at least appeared once and only once (I think!). The thing that is wrong is that, I guess, the empty row in DB was added to satisfy the FK (marc_subfield_structure.authorised_value), but it must actually be set to NULL instead of "". The update DB entry (16.06.00.033) set it to NULL, but next change to the framework set it to "". All of that to say that I think we should: 1. uniformize the code to make sure we are using the same code everywhere (also see Koha::AuthorisedValues->new->categories vs Koha::AuthorisedValueCategories->search) 2. Add the empty option in template, but insert NULL when picked 3. In DB, update the '' occurrences with NULL 4. Remove the '' DB row from the .sql installer file Hope that makes sense! -- 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=20280 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (And so comment 1 was wrong!) -- 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=20280 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> ---
All of that to say that I think we should: 1. uniformize the code to make sure we are using the same code everywhere (also see Koha::AuthorisedValues->new->categories vs Koha::AuthorisedValueCategories->search) 2. Add the empty option in template, but insert NULL when picked 3. In DB, update the '' occurrences with NULL 4. Remove the '' DB row from the .sql installer file
Hope that makes sense!
It does make sense, but no idea how to start there! -- 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=20280 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- *** Bug 25910 has been marked as a duplicate of this bug. *** -- 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=20280 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- The tricky part is the installer files. It's a mess and it will be too time consuming to deal with them. -- 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=20280 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 107458 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=107458&action=edit Bug 20280: DB changes - wip -- 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=20280 --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Here is a start. I gave up when I see the amount of conscientious work that needs to be done in the .sql files of the different languages. -- 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=20280 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Maybe we could revive that after more installers have been moved to the yml structure? (RESOLVED LATER?) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org