Bug 26662 - Automated authority linking doesn't work with custom authority type
Summary: Automated authority linking doesn't work with custom authority type
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Authority data support (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-12 23:59 UTC by David Cook
Modified: 2024-12-19 14:20 UTC (History)
2 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2020-10-12 23:59:58 UTC
If you're using custom authority types, automatic linking via C4::Biblio::LinkBibHeadingsToAuthorities will never work.

It's because C4::Heading::MARC21 has a hard-coded mapping of bib fields to authority types (instead of consulting the MARC bibliographic framework).

This means if you're using "CORPO_NAME_AWSEOME" instead of "CORPO_NAME" for your authorities, you'll never get an automated match, since C4::Heading::_search (used ultimately by C4::Linker::Default) uses the hard-coded auth_type from C4::Heading::MARC21.
Comment 1 David Cook 2020-10-13 00:13:29 UTC
I suppose that a fix could be done by looking up the framework thesaurus in C4::Heading::new_from_field and overriding the default hard-coded auth_type...

(At a glance, LinkBibHeadingsToAuthorities seems to be used whether or not a framework thesaurus has even been defined. That's also... special... but that's a different issue for another day.)
Comment 2 David Cook 2020-10-13 00:14:27 UTC
We'd want to add some unit tests to t/db_dependent/Heading.t too for checking the correct auth_type...
Comment 3 Magnus Enger 2024-12-19 14:20:29 UTC
That hardcoding in C4::Heading::MARC21 makes things more inflexible then I thought they would be...