https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43489 --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 209024 (full commit message, for the test plan) Bug 43489: Scope thesaurus filtering by auth_type, not by MARC21 tag position C4::Heading::MARC21::parse_heading decided whether to compute a thesaurus constraint purely from tag position ($tag =~ m/6../). Bug 43483 fixed the most common trigger of this (a blank/undefined 2nd indicator being coerced to the literal 'notdefined' thesaurus), but a 6XX name heading with a coded 2nd indicator of 0, 1 or 4 still got a thesaurus constraint ('lcsh', 'lcac' or 'notspecified') applied during authority matching, while the equivalent 1XX/7XX occurrence of the same name never does. The same personal, corporate or meeting name could therefore still be matched or created against two separate authority records depending on which field it appeared in. Those three values only say that the heading comes from the Library of Congress regime, which is where name authorities (NACO) live. They say nothing about a name: it is the same entity wherever it is used, as author, added entry or subject. This introduces a table of auth_types for which a thesaurus is a meaningful concept (TOPIC_TERM, GEOGR_NAME, CHRON_TERM, GENRE/FORM, MED_PERFRM), and a table of the thesauri that only describe the LC regime (lcsh, lcac, notspecified). For a 6XX field whose auth_type is not thesaurus-scoped, a thesaurus drawn from that second table is discarded. A name that explicitly names another vocabulary (2nd indicator 2, 3, 5, 6 or 7 with $2) keeps its thesaurus, so a heading taken from, for example, MeSH or a local source is still not merged with the LC one. Test plan: 1. Run the unit tests inside KTD: ktd --shell --run 'prove t/db_dependent/Heading_MARC21.t t/db_dependent/Heading.t' They pass. To see them fail, revert only the change to C4/Heading/MARC21.pm and run them again: the cases for 600/610 with 2nd indicator 0, 1 and 4 fail. 2. Enable the LinkerConsiderThesaurus, AutoLinkBiblios and AutoCreateAuthorities system preferences. 3. Make sure there is no authority for "Goddard, Giles" yet. 4. Catalogue a new bibliographic record with the same name in a 100 and in a 600 with the 2nd indicator coded 0 (LCSH): 100 1_ $a Goddard, Giles $d 1962- 600 10 $a Goddard, Giles $d 1962- 5. Save it and search Authorities for "Goddard". - Without this patch: two authority records. - With this patch: one authority record, linked from both fields. 6. Repeat with the 600 as 600 14 $a Goddard, Giles $d 1962- and confirm it is linked to that same authority record too. 7. Run the other linker tests and confirm there are no regressions: ktd --shell --run 'prove t/db_dependent/Linker_Default.t t/db_dependent/Linker_FirstMatch.t t/db_dependent/AuthoritiesMarc.t t/db_dependent/Koha/Authority.t' 8. Sign off Depends on Bug 43483. -- You are receiving this mail because: You are watching all bug changes.