Bug 30850 - Add default mapping for biblio.author to 110$a (MARC21)
Summary: Add default mapping for biblio.author to 110$a (MARC21)
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Caroline Cyr La Rose
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-25 22:09 UTC by Caroline Cyr La Rose
Modified: 2023-12-28 20:42 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement maps 110$a (corporate author in MARC21) to biblio.author in the default framework. Having the corporate author in biblio.author ensures it will appear wherever the author usually appears in the staff interface.
Version(s) released in:
22.11.00


Attachments
Bug 30850: Add default mapping for biblio.author to 110$a (MARC21) (4.15 KB, patch)
2022-05-25 22:44 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 30850: Add default mapping for biblio.author to 110$a (MARC21) (4.20 KB, patch)
2022-05-28 19:57 UTC, David Nind
Details | Diff | Splinter Review
Bug 30850: Add default mapping for biblio.author to 110$a (MARC21) (4.20 KB, patch)
2022-06-02 14:25 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 30850: dbrev to inform existing users of the mapping change (1.52 KB, patch)
2022-06-02 14:25 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 30850: dbrev to inform existing users of the mapping change (1.56 KB, patch)
2022-06-02 22:25 UTC, David Nind
Details | Diff | Splinter Review
Bug 30850: Add default mapping for biblio.author to 110$a (MARC21) (4.30 KB, patch)
2022-06-03 06:31 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 30850: dbrev to inform existing users of the mapping change (1.66 KB, patch)
2022-06-03 06:31 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 30850: (QA follow-up) Cosmetic changes to atomic update (1.70 KB, patch)
2022-06-03 06:31 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2022-05-25 22:09:45 UTC
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.
Comment 1 Caroline Cyr La Rose 2022-05-25 22:44:57 UTC
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
Comment 2 Katrin Fischer 2022-05-27 15:37:39 UTC
I've thought about this recently as well - I think it's a great idea.
Comment 3 David Nind 2022-05-28 19:57:34 UTC
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>
Comment 4 David Nind 2022-05-28 20:01:55 UTC
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.
Comment 5 Marcel de Rooy 2022-05-31 11:27:55 UTC
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.
Comment 6 Caroline Cyr La Rose 2022-05-31 15:02:34 UTC
(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.
Comment 7 Marcel de Rooy 2022-06-01 11:15:26 UTC
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 !
Comment 8 Caroline Cyr La Rose 2022-06-02 14:25:37 UTC
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>
Comment 9 Caroline Cyr La Rose 2022-06-02 14:25:42 UTC
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
Comment 10 Caroline Cyr La Rose 2022-06-02 14:37:16 UTC
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
Comment 11 David Nind 2022-06-02 22:25:30 UTC
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>
Comment 12 David Nind 2022-06-02 22:54:35 UTC
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).
Comment 13 Marcel de Rooy 2022-06-03 06:31:21 UTC
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>
Comment 14 Marcel de Rooy 2022-06-03 06:31:25 UTC
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>
Comment 15 Marcel de Rooy 2022-06-03 06:31:29 UTC
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>
Comment 16 Marcel de Rooy 2022-06-03 06:33:14 UTC
(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 ?
Comment 17 Tomás Cohen Arazi 2022-06-08 14:27:59 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 18 Lucas Gass 2022-07-12 16:50:04 UTC
Enhancement will not be backported to 22.05, if needed please ask!