We are seeing more libraries ending up with 'SUBDIV' type authority records in their systems. Koha has no support for these. They can be added to the authority types in the staff interface, however, values are hardcoded in various modules and Koha has no concept of how to link a subfield heading to a record, we only deal in whole fields The larger problem is something to think about, but more directly we should not allow indexing to die when an unknown type is encountered To recreate: 1 - Import a subdivision authority record via Z39 or use the one attached to this bug 2 - perl misc/search_tools/rebuild_elasticsearch.pl -v -d 3 - Authority indexing dies: Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202. Use of uninitialized value $tag in regexp compilation at /usr/share/perl5/MARC/Record.pm line 206. Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 207. Can't call method "tag" on an undefined value at /kohadevbox/koha/C4/Heading.pm line 71.
Created attachment 117378 [details] [review] Bug 27784: Unit tests
Created attachment 117379 [details] [review] Bug 27784: Don't parse subdivision authorities as headings Subdivision authorities are not used for linking, however, they are recognized by C4::AuthoritiesMarc While these records are not used for linking, they could provide reference and should be allowed to exist in the catalog without breaking ES indexing THis patch simply skips the step of parsing the authorities into the linking form if the type contains '_SUBD' To test: 1 - Import a subdivision authority record via Z39 or use the one attached to this bug 2 - perl misc/search_tools/rebuild_elasticsearch.pl -v -d 3 - Authority indexing dies: Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202. Use of uninitialized value $tag in regexp compilation at /usr/share/perl5/MARC/Record.pm line 206. Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 207. Can't call method "tag" on an undefined value at /kohadevbox/koha/C4/Heading.pm line 71. 4 - Apply patches 5 - reindex 6 - Success!
Created attachment 117401 [details] Sample record
Created attachment 117459 [details] [review] Bug 27784: Unit tests Signed-off-by: David Nind <david@davidnind.com>
Created attachment 117460 [details] [review] Bug 27784: Don't parse subdivision authorities as headings Subdivision authorities are not used for linking, however, they are recognized by C4::AuthoritiesMarc While these records are not used for linking, they could provide reference and should be allowed to exist in the catalog without breaking ES indexing THis patch simply skips the step of parsing the authorities into the linking form if the type contains '_SUBD' To test: 1 - Import a subdivision authority record via Z39 or use the one attached to this bug 2 - perl misc/search_tools/rebuild_elasticsearch.pl -v -d 3 - Authority indexing dies: Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202. Use of uninitialized value $tag in regexp compilation at /usr/share/perl5/MARC/Record.pm line 206. Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 207. Can't call method "tag" on an undefined value at /kohadevbox/koha/C4/Heading.pm line 71. 4 - Apply patches 5 - reindex 6 - Success! Signed-off-by: David Nind <david@davidnind.com>
Thanks Nick for providing a sample record!
Created attachment 117563 [details] [review] Bug 27784: Unit tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 117564 [details] [review] Bug 27784: Don't parse subdivision authorities as headings Subdivision authorities are not used for linking, however, they are recognized by C4::AuthoritiesMarc While these records are not used for linking, they could provide reference and should be allowed to exist in the catalog without breaking ES indexing THis patch simply skips the step of parsing the authorities into the linking form if the type contains '_SUBD' To test: 1 - Import a subdivision authority record via Z39 or use the one attached to this bug 2 - perl misc/search_tools/rebuild_elasticsearch.pl -v -d 3 - Authority indexing dies: Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202. Use of uninitialized value $tag in regexp compilation at /usr/share/perl5/MARC/Record.pm line 206. Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 207. Can't call method "tag" on an undefined value at /kohadevbox/koha/C4/Heading.pm line 71. 4 - Apply patches 5 - reindex 6 - Success! Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
A reasonable and pragmatic solution to the issue. Whilst it would be nice to add support for subdivision linking, this patch is a pragmatic solution to prevent indexing explosions. It works as expected, has a unit regression test and passes the QA script. Passing QA
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.04
Pushed to 20.05.x for 20.05.10
Backported: Pushed to 19.11.x branch for 19.11.16