https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43489 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 205296 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205296&action=edit 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 any 6XX occurrence of a name heading with an explicitly coded indicator 2 (0-7) could still get a thesaurus constraint applied during authority matching, while the equivalent 1XX/7XX occurrence of the same name never does - so the same personal, corporate or meeting name could still end up matched/created against two separate authority records depending on which field it appeared in and how indicator 2 was coded. The thesaurus concept only has meaning for genuine controlled subject vocabularies (LCSH vs MeSH vs Sears etc) that may define overlapping terms - it has no equivalent meaning for named real-world entities. NACO name authority records are reused identically regardless of whether the name functions as a main entry, added entry, or subject added entry. 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 only computes/applies a thesaurus constraint for a 6XX field whose auth_type is in that set. Name-entity auth_types (PERSO_NAME, CORPO_NAME, MEETI_NAME, UNIF_TITLE, NAME_EVENT) never get a thesaurus constraint, in any tag position, regardless of how indicator 2 is coded. Test plan: 1. Run t/db_dependent/Heading_MARC21.t and t/db_dependent/Heading.t - all tests pass, including new cases confirming a PERSO_NAME/ CORPO_NAME 6XX field with an explicitly coded thesaurus indicator still gets no thesaurus constraint, while a TOPIC_TERM 6XX field's existing thesaurus-scoped behaviour is unchanged. 2. Turn on LinkerConsiderThesaurus, AutoLinkBiblios and AutoCreateAuthorities. 3. Catalogue a bibliographic record with the same personal name in a 100 field and a 600 field with indicator 2 explicitly coded (e.g. 0 for lcsh), with no existing matching authority. 4. Confirm only one authority record is created, used by both fields. 5. Run t/db_dependent/Linker_Default.t, t/db_dependent/Linker_FirstMatch.t, t/db_dependent/AuthoritiesMarc.t and t/db_dependent/Koha/Authority.t - all pass, no regressions. Depends on Bug 43483. -- You are receiving this mail because: You are watching all bug changes.