Bug 32906 - Make 'Replace record via Z3950/SRU' buttons in authorities work consistently
Summary: Make 'Replace record via Z3950/SRU' buttons in authorities work consistently
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 29173
Blocks:
  Show dependency treegraph
 
Reported: 2023-02-08 07:05 UTC by Martin Renvoize (ashimema)
Modified: 2024-11-07 03:06 UTC (History)
2 users (show)

See Also:
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 Martin Renvoize (ashimema) 2023-02-08 07:05:51 UTC
Bug 29173 implemented search pre-fill for the Replace via Z3950 search form from the authority detail page, but it did so in a very different, and MARC21 specific, way from the same button on the 'Edit authority' page.

On the edit authority page we extract the pre-fill terms from the current page and pass them as URI parameters to the search pop-over form.  I think we could take a similar approach on the detail display page and perhaps even make the feature work for both MARC21 and UNIMARC in this way?
Comment 1 Nick Clemens (kidclamp) 2023-05-01 18:45:35 UTC
I don't see the difference, it looks like both pass the authid and pull the terms from marc, and accounts for UNIMARC, maybe another bug fixed it?

See also bug 33445
Comment 2 Phil Ringnalda 2024-11-07 03:06:42 UTC
I do see an architectural bug, but it's a big stretch to say that this bug is about it.

Both do support UNIMARC, the editor because the poorly-named GetMandatoryFieldZ3950 maps 200a to 'authorpersonal', 210a to 'authorcorp', and 230a to 'uniformtitle', the details display because the authfields_mapping added by attachment 146380 [details] [review] in bug 29173 maps 200a to 'authorpersonal', 210a to 'authorcorp' and 'authormeetingcon', 230a to 'uniformtitle', and 250a to 'subject'.

Wait, those are rather different mappings! And indeed, if you Replace via Z39.50 from the details display for a UNIMARC corporate name, the existing value is prefilled for both Author (corporate) and Author (meeting / conference) which will fail with most if not all servers, and you only get prefill for a topical subject record if you replace from the details display, not the editor (probably because the patch for UNIMARC in GetMandatoryFieldZ3950 was written by a different author than the original feature patch, and the UNIMARC person realized that the other person didn't actually make subject work and just skipped it, not realizing that when I changed topic to subject to make MARC21 work six years later, I wouldn't know to also add in 250a for UNIMARC).

So, yes, it might be better if there was an exported GetAuthorityZ3950SRUMapping that both the editor and details used, but it's a deep rabbithole. The right thing to prefill actually depends on heading, MARC flavor, and target server (from what I use, 130a should go in Title (uniform) if I'm searching LoC, but Title (any) if I'm searching OCLC). And given that SRU can map any index or no index to a particular input, and you can be searching one or more servers, really making mapping work requires some weird ranked-choice prefill pref on Z39.50/SRU server definitions.

Not convinced that the non-rabbithole "just have a single exported GetMapping that both can use rather than having two separate mappings" would be worth the trouble. And don't even think about making it worthwhile by doing the same thing for biblios, you absolutely Do. Not. Want. to look at what Replace via Z39.50 from a bib detail display does.