[Bug 43483] New: Authority linker treats the same name heading differently in 6XX vs 1XX/7XX
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43483 Bug ID: 43483 Summary: Authority linker treats the same name heading differently in 6XX vs 1XX/7XX Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: MARC Authority data support Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Target Milestone: --- When LinkerConsiderThesaurus is enabled, the authority linker treats a name heading differently depending on whether it appears in a name field (100/110/111/700/710/711 etc, where MARC21's 2nd indicator is undefined) or in the equivalent name-used-as-subject field (600/610/611 etc, where the 2nd indicator encodes the subject thesaurus). C4::Heading::MARC21::parse_heading only computes a 'thesaurus' value for 6XX tags: my $thesaurus = $tag =~ m/6../ ? _get_subject_thesaurus($field) : undef; # We can't know the thesaurus for non-subject fields C4::Heading::_search then only adds a thesaurus constraint to the authority match query when $thesaurus is defined: if ( $check_thesaurus && $thesaurus ) { push @marclist, 'thesaurus'; ... } So the same person can end up matched to, or auto-creating, two separate authority records from the same bibliographic record: one for their 100 field (no thesaurus constraint, matches/creates against auth_type PERSO_NAME alone) and a different one for their 600 field (thesaurus constraint applied, even when indicator 2 is blank, which is treated as the placeholder thesaurus 'notdefined'). The two authority records end up with identical headings, so Koha's own duplicate-authority detection later flags them as duplicates when a cataloguer tries to merge or link them manually, even though the automatic linker created them as two separate records in the first place. This is not a new regression. Bug 33277 (2023) deliberately made thesaurus undef for non-6XX tags, to stop 100/700 fields failing to match authorities that had no thesaurus recorded at all. Its commit message notes the trade-off explicitly: "this means that Koha does not support multiple thesaurus records for authorities outside of subjects." Nobody has revisited the resulting asymmetry between a name field and the same auth_type used as a subject field. This was reported by a customer after bug 31925 made the 6XX-vs-thesaurus distinction more reliable (correctly coding 008/11 for FAST/MeSH/etc on newly created authorities), which appears to have made this pre-existing asymmetry more visible: a blank indicator 2 on a 600 is still treated as thesaurus 'notdefined' and still gets the thesaurus filter applied during matching, unlike the 1XX/7XX occurrence of the exact same name. Test plan: 1. Turn on LinkerConsiderThesaurus, AutoLinkBiblios and AutoCreateAuthorities. 2. Catalogue a bibliographic record with the same personal name in both a 100 (or 700) field and a 600 field, e.g.: 100 1_ $a Goddard, Giles 600 1_ $a Goddard, Giles $x Criticism and interpretation (blank/undefined 2nd indicator on the 600, i.e. no thesaurus recorded) 3. Save the record, with no existing matching authority in the catalogue. 4. Note that two separate authority records are created for "Goddard, Giles" -- one from the 100, one from the 600. 5. Try to manually merge or link the two authorities together in the Authorities module. Observe that Koha's duplicate detection considers them duplicates of each other, confirming they should have matched to a single authority in the first place. Related bugs: Bug 31925 -- AutoCreateAuthorities needs to preserve subject heading thesaurus. This report surfaced during discussion of that fix; it is not a regression caused by it. Bug 33277 -- Do not search using thesaurus when linking non 6XX fields. Introduced the asymmetry described above, as an accepted trade-off at the time. Bug 39503 -- Linker should always respect thesaurus with LinkerConsiderThesaurus on. Related but narrower: only addresses collapsing 008/11='z' plus 040$f within 6XX-to-6XX matching. Bug 41714 -- MARC21 authorities thesaurus link hardcoded. Touches the same C4::Heading::MARC21 code (the tag-to-auth_type table), but only makes that mapping configurable via frameworks; it does not touch the thesaurus computation or filtering discussed here. -- 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=43483 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31925, | |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=33277, | |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=39503, | |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=41714 -- 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=43483 cgresser <cgresser@jesuit.org.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cgresser@jesuit.org.uk --- Comment #1 from cgresser <cgresser@jesuit.org.uk> --- Sorry, I might be reading this wrongly, and might have reported this badly, but the authority heading in 100 and 600, must be different: In our example, the author of the book is writing about himself (a biography), so 100 1_ $a Goddard, Giles,$d1962- 600 1_ $a Goddard, Giles,$d1962- The authority linked from 100 field is only when Rev. Giles Goddard is the writer, the authority linked from 600 field is when Rev. Giles Goddard is being written about. Like I could write a book about him (fear not, I probably won't!), and then would need to use the same authority of 600 1 _ $a Goddard, Giles,$d1962- . However, the 100 in record 1/book 1 and 700 of the record 2/book 2 should link to the same authority. record 2/book 2 might a book where the author has been involved, which could be: 100 1_ $a Randomlynamed, Joe,$d1982 700 1_ $a Goddard, Giles,$d1962- Joe Randomlynamed and Giles Goddard wrote this book together (or were editors). If the authority in our example 1/book 1 for the 100 and the one in our example 2/book 2 for the 700 is the same authority record, then the end user clicking on the link in the OPAC get's books which are either solely written or edited by Giles Goddard (as in 100 and 700). That would make sense to me in Koha. If you want to see an example for this: https://hey.koha.openfifth.net/cgi-bin/koha/opac-search.pl?q=an:141508 books where G.K. Chesteron is the author (100). Books where G.K. is the subject (600) https://hey.koha.openfifth.net/cgi-bin/koha/opac-search.pl?q=an:141508 I might be wrong, but I think that Koha gets confused about these being the same authority. Hope this helps... -- 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=43483 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CONFIRMED -- 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=43483 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk -- 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=43483 Esther Melander <esther.melander@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |esther.melander@bywatersolu | |tions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43483 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43483 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Comma delimited| |Martin Renvoize list of Sponsors| |<martin.renvoize@gmail.com> Patch complexity|--- |Trivial patch Sponsorship status|--- |Sponsored Status|CONFIRMED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43483 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 205295 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205295&action=edit Bug 43483: Don't treat blank thesaurus indicator as 'notdefined' for matching C4::Heading::MARC21::_get_subject_thesaurus coerced a blank/undefined 2nd indicator on a 6XX field to the literal thesaurus value 'notdefined', while parse_heading leaves the thesaurus undef for the equivalent 1XX/7XX name field. C4::Heading::_search only applies a thesaurus constraint to the authority-matching query when thesaurus is defined, so the same personal name ended up searched/created without any thesaurus constraint via a 100/700 field, but with a hard 'notdefined' constraint via a 600 field with no thesaurus recorded - letting the linker create two separate authority records for the same heading, which Koha's own duplicate-authority detection then flags as duplicates. A blank/undefined 2nd indicator asserts no thesaurus at all, so it should be treated the same as a non-subject field: leave thesaurus undef, and only apply a constraint when a thesaurus is explicitly coded (indicator 0-7). Test plan: 1. Run t/db_dependent/Heading_MARC21.t and t/db_dependent/Heading.t - all tests pass, including new cases asserting no thesaurus is generated for a 6XX field with a blank/undefined 2nd indicator, and that no thesaurus constraint is added to the search query in that case. 2. Turn on LinkerConsiderThesaurus, AutoLinkBiblios and AutoCreateAuthorities. 3. Catalogue a bibliographic record with the same personal name in both a 100 (or 700) field and a 600 field with a blank 2nd indicator, e.g.: 100 1_ $a Goddard, Giles 600 1_ $a Goddard, Giles $x Criticism and interpretation 4. Save the record, with no existing matching authority in the catalogue. 5. Confirm only one authority record is created for "Goddard, Giles", used by both the 100 and the 600. Sponsored-by: Martin Renvoize <martin.renvoize@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43483 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |43489 Depends on| |31925 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31925 [Bug 31925] AutoCreateAuthorities needs to preserve subject heading thesaurus to not create duplicate authority records https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43489 [Bug 43489] Thesaurus filtering should be scoped by auth_type, not by MARC21 tag position -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43483 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |phil@chetcolibrary.org -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org