Currently, biblio.author is only linked to 100$a, which is fine in most cases. But some records have a corporate author (110$a) and those authors don't appear anywhere where the author usually appears (checkout table, letters, labels, etc.) I propose we add a default mapping from 110$a to biblio.author.
Created attachment 135356 [details] [review] Bug 30850: Add default mapping for biblio.author to 110$a (MARC21) This patch adds a mapping to biblio.author in 110$a in the default framework Note: I added lots of tests for different scenarios, I'm not sure it's necessary to test everything. I don't want this to be a deterrent! The first one is necessary, the rest are use cases. Note 2: I don't work with ktd so maybe the steps for loading new frameworks are different, sorry about that, I honestly don't know another way to do it. Test 1 - basic test Before applying patch, 1- Create a new record with a corporate author (110$a) 2- Query the database, author should be null select author from biblio where biblionumber = XXXX; (do other control tests if you want/need before applying the patch) 3- Apply patch 4- Delete frameworks delete from biblio_framework; delete from marc_subfield_structure; delete from marc_tag_structure; 5- Load new frameworks ./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load 6- Edit the record, don't change anything and save it 7- Query the database, author should be filled 8- Go to Administration > MARC Bibliographic framework test, everything should be OK Test 2 - checkouts table Before applying patch, 1- Create a new record and item with a corporate author (110$a) 2- Checkout the item for that record to a patron Note that the author is not listed in the checkouts table 3- Apply patch 4- Delete frameworks delete from biblio_framework; delete from marc_subfield_structure; delete from marc_tag_structure; 5- Load new frameworks ./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load 6- Edit the record, don't change anything and save it 7- Refresh the checkouts table, the author should be listed Test 3 - notices and slips Before applying patch, 1- Go to Tools > Notices & slips 2- Edit ISSUESLIP and add <<biblio.author>> after <<biblio.title>> 3- Save the notice 4- Create a new record and item with a corporate author (110$a) 5- Checkout the item for that record to a patron 6- Print the checkout slip Note that the author is not listed on the slip 7- Apply patch 8- Delete frameworks delete from biblio_framework; delete from marc_subfield_structure; delete from marc_tag_structure; 9- Load new frameworks ./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load 10- Edit the record, don't change anything and save it 11- Print the checkout slip, the author should be listed Test 4 - labels Before applying the patch, 1- Create a new record and item with a corporate author (110$a) 2- Go to Tools > Label Creator 3- Create a label batch with that item 4- Export the batch in PDF using the Avery 5160 template and 'Label test' layout Note that the author is not listed 5- Apply patch 6- Delete frameworks delete from biblio_framework; delete from marc_subfield_structure; delete from marc_tag_structure; 7- Load new frameworks ./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load 8- Edit the record, don't change anything and save it 9- Export the label batch again, the author should be listed
I've thought about this recently as well - I think it's a great idea.
Created attachment 135440 [details] [review] Bug 30850: Add default mapping for biblio.author to 110$a (MARC21) This patch adds a mapping to biblio.author in 110$a in the default framework Note: I added lots of tests for different scenarios, I'm not sure it's necessary to test everything. I don't want this to be a deterrent! The first one is necessary, the rest are use cases. Note 2: I don't work with ktd so maybe the steps for loading new frameworks are different, sorry about that, I honestly don't know another way to do it. Test 1 - basic test Before applying patch, 1- Create a new record with a corporate author (110$a) 2- Query the database, author should be null select author from biblio where biblionumber = XXXX; (do other control tests if you want/need before applying the patch) 3- Apply patch 4- Delete frameworks delete from biblio_framework; delete from marc_subfield_structure; delete from marc_tag_structure; 5- Load new frameworks ./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load 6- Edit the record, don't change anything and save it 7- Query the database, author should be filled 8- Go to Administration > MARC Bibliographic framework test, everything should be OK Test 2 - checkouts table Before applying patch, 1- Create a new record and item with a corporate author (110$a) 2- Checkout the item for that record to a patron Note that the author is not listed in the checkouts table 3- Apply patch 4- Delete frameworks delete from biblio_framework; delete from marc_subfield_structure; delete from marc_tag_structure; 5- Load new frameworks ./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load 6- Edit the record, don't change anything and save it 7- Refresh the checkouts table, the author should be listed Test 3 - notices and slips Before applying patch, 1- Go to Tools > Notices & slips 2- Edit ISSUESLIP and add <<biblio.author>> after <<biblio.title>> 3- Save the notice 4- Create a new record and item with a corporate author (110$a) 5- Checkout the item for that record to a patron 6- Print the checkout slip Note that the author is not listed on the slip 7- Apply patch 8- Delete frameworks delete from biblio_framework; delete from marc_subfield_structure; delete from marc_tag_structure; 9- Load new frameworks ./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load 10- Edit the record, don't change anything and save it 11- Print the checkout slip, the author should be listed Test 4 - labels Before applying the patch, 1- Create a new record and item with a corporate author (110$a) 2- Go to Tools > Label Creator 3- Create a label batch with that item 4- Export the batch in PDF using the Avery 5160 template and 'Label test' layout Note that the author is not listed 5- Apply patch 6- Delete frameworks delete from biblio_framework; delete from marc_subfield_structure; delete from marc_tag_structure; 7- Load new frameworks ./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load 8- Edit the record, don't change anything and save it 9- Export the label batch again, the author should be listed Signed-off-by: David Nind <david@davidnind.com>
Testing notes using koha-testing-docker: - I used record 231 as this has a corporate author (110$a). - I'm not sure of the best way to load the frameworks in koha-testing-docker, but after applying the patch I ran reset_all, instead of deleting the frameworks and reloading the new frameworks.
QA Comment: I am still missing something here. What we do, is making sure that new installs will map 110a too. But we do not care about the existing installs. I understand that we might not dictate this setting to all these installs, but we should probably inform them about this choice by printing an informational message from a dbrev (atomic update). Please add also something in Release notes.
(In reply to Marcel de Rooy from comment #5) > but we should probably inform them about this choice by printing an > informational message from a dbrev (atomic update). Sorry, I have no idea what that means. Please explain like I'm 5. > Please add also something in Release notes. Done.
Might be the easiest to point you to an example that you could copy and adjust: Take e.g. this file installer/data/mysql/db_revs/220600000.pl This dbrev (database revision) or atomic update only contains a informational print statement. Copy this file to installer/data/mysql/atomicupdate/bug_30850.pl Adjust it, changing the description, bug number and print statements. When you remove the utf8 clutter here, no need to keep the use uft8; use Encode and the encode_utf8 calls before printing (with the say statement). Test it by running updatedatabase.pl And ready to go !
Created attachment 135587 [details] [review] Bug 30850: Add default mapping for biblio.author to 110$a (MARC21) This patch adds a mapping to biblio.author in 110$a in the default framework Note: I added lots of tests for different scenarios, I'm not sure it's necessary to test everything. I don't want this to be a deterrent! The first one is necessary, the rest are use cases. Note 2: I don't work with ktd so maybe the steps for loading new frameworks are different, sorry about that, I honestly don't know another way to do it. Test 1 - basic test Before applying patch, 1- Create a new record with a corporate author (110$a) 2- Query the database, author should be null select author from biblio where biblionumber = XXXX; (do other control tests if you want/need before applying the patch) 3- Apply patch 4- Delete frameworks delete from biblio_framework; delete from marc_subfield_structure; delete from marc_tag_structure; 5- Load new frameworks ./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load 6- Edit the record, don't change anything and save it 7- Query the database, author should be filled 8- Go to Administration > MARC Bibliographic framework test, everything should be OK Test 2 - checkouts table Before applying patch, 1- Create a new record and item with a corporate author (110$a) 2- Checkout the item for that record to a patron Note that the author is not listed in the checkouts table 3- Apply patch 4- Delete frameworks delete from biblio_framework; delete from marc_subfield_structure; delete from marc_tag_structure; 5- Load new frameworks ./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load 6- Edit the record, don't change anything and save it 7- Refresh the checkouts table, the author should be listed Test 3 - notices and slips Before applying patch, 1- Go to Tools > Notices & slips 2- Edit ISSUESLIP and add <<biblio.author>> after <<biblio.title>> 3- Save the notice 4- Create a new record and item with a corporate author (110$a) 5- Checkout the item for that record to a patron 6- Print the checkout slip Note that the author is not listed on the slip 7- Apply patch 8- Delete frameworks delete from biblio_framework; delete from marc_subfield_structure; delete from marc_tag_structure; 9- Load new frameworks ./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load 10- Edit the record, don't change anything and save it 11- Print the checkout slip, the author should be listed Test 4 - labels Before applying the patch, 1- Create a new record and item with a corporate author (110$a) 2- Go to Tools > Label Creator 3- Create a label batch with that item 4- Export the batch in PDF using the Avery 5160 template and 'Label test' layout Note that the author is not listed 5- Apply patch 6- Delete frameworks delete from biblio_framework; delete from marc_subfield_structure; delete from marc_tag_structure; 7- Load new frameworks ./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load 8- Edit the record, don't change anything and save it 9- Export the label batch again, the author should be listed Signed-off-by: David Nind <david@davidnind.com>
Created attachment 135588 [details] [review] Bug 30850: dbrev to inform existing users of the mapping change This patch adds a message in a dbrev to inform users of existing installations that they might want to add a mapping from 110$a to biblio.author
Hi Marcel, I did what you said. I hope it's ok. I admit I'm a bit out of my depth, but I guess copy and pasting is something I can do, lol! Caroline
Created attachment 135633 [details] [review] Bug 30850: dbrev to inform existing users of the mapping change This patch adds a message in a dbrev to inform users of existing installations that they might want to add a mapping from 110$a to biblio.author Signed-off-by: David Nind <david@davidnind.com>
I have signed-off the dbrev patch (using koha-testing-docker). The instructions worked (see note) for updating an existing installation: 1. Apply patches. 2. Run updatedatabase, flush_memcached, and restart_all. 3. Add mapping for 110$a to biblio.author (Administration > Koha to MARC mapping). 4. Run ./misc/batchRebuilBiblioTables.pl -c (see note). Note: - I encountered this error message with the KTD sample data when running ./misc/batchRebuilBiblioTables.pl -c C4::Biblio::_koha_modify_biblioitem_nonmarc(): DBI Exception: DBD::mysql::st execute failed: Data too long for column 'lccn' at row 1 at misc/batchRebuildBiblioTables.pl line 71 - I have logged bug 30896 for this. - To get around the error, I used Tools > Batch item modification to delete the LCCN data in 010 (created report to list all the record numbers, added MARC modification templates to delete fields 010 $8 $a $b $z, ran batch record modification).
Created attachment 135637 [details] [review] Bug 30850: Add default mapping for biblio.author to 110$a (MARC21) This patch adds a mapping to biblio.author in 110$a in the default framework Note: I added lots of tests for different scenarios, I'm not sure it's necessary to test everything. I don't want this to be a deterrent! The first one is necessary, the rest are use cases. Note 2: I don't work with ktd so maybe the steps for loading new frameworks are different, sorry about that, I honestly don't know another way to do it. Test 1 - basic test Before applying patch, 1- Create a new record with a corporate author (110$a) 2- Query the database, author should be null select author from biblio where biblionumber = XXXX; (do other control tests if you want/need before applying the patch) 3- Apply patch 4- Delete frameworks delete from biblio_framework; delete from marc_subfield_structure; delete from marc_tag_structure; 5- Load new frameworks ./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load 6- Edit the record, don't change anything and save it 7- Query the database, author should be filled 8- Go to Administration > MARC Bibliographic framework test, everything should be OK Test 2 - checkouts table Before applying patch, 1- Create a new record and item with a corporate author (110$a) 2- Checkout the item for that record to a patron Note that the author is not listed in the checkouts table 3- Apply patch 4- Delete frameworks delete from biblio_framework; delete from marc_subfield_structure; delete from marc_tag_structure; 5- Load new frameworks ./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load 6- Edit the record, don't change anything and save it 7- Refresh the checkouts table, the author should be listed Test 3 - notices and slips Before applying patch, 1- Go to Tools > Notices & slips 2- Edit ISSUESLIP and add <<biblio.author>> after <<biblio.title>> 3- Save the notice 4- Create a new record and item with a corporate author (110$a) 5- Checkout the item for that record to a patron 6- Print the checkout slip Note that the author is not listed on the slip 7- Apply patch 8- Delete frameworks delete from biblio_framework; delete from marc_subfield_structure; delete from marc_tag_structure; 9- Load new frameworks ./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load 10- Edit the record, don't change anything and save it 11- Print the checkout slip, the author should be listed Test 4 - labels Before applying the patch, 1- Create a new record and item with a corporate author (110$a) 2- Go to Tools > Label Creator 3- Create a label batch with that item 4- Export the batch in PDF using the Avery 5160 template and 'Label test' layout Note that the author is not listed 5- Apply patch 6- Delete frameworks delete from biblio_framework; delete from marc_subfield_structure; delete from marc_tag_structure; 7- Load new frameworks ./misc/load_yaml.pl -f installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml --load 8- Edit the record, don't change anything and save it 9- Export the label batch again, the author should be listed Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 135638 [details] [review] Bug 30850: dbrev to inform existing users of the mapping change This patch adds a message in a dbrev to inform users of existing installations that they might want to add a mapping from 110$a to biblio.author Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 135639 [details] [review] Bug 30850: (QA follow-up) Cosmetic changes to atomic update No need to encode, etc. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(In reply to Caroline Cyr La Rose from comment #10) > Hi Marcel, > > I did what you said. I hope it's ok. > > I admit I'm a bit out of my depth, but I guess copy and pasting is something > I can do, lol! > > Caroline Great, Caroline. What isnt in your reach now? :) If we hadnt copy and paste, what should developers do ?
Pushed to master for 22.11. Nice work everyone, thanks!
Enhancement will not be backported to 22.05, if needed please ask!