Koha-clms/koha-tmpl/intranet-tmpl/prog/en/modules
Andreas Roussos d88274881e
Bug 21453: Copy data to the correct subfields when linking authorities with authorities
When using the authority finder plugin from within Koha's
Authorities module, you can pick an entry from the 'Special
relationship:' dropdown menu in order to set the relationship
between authorities.

The problem is that in UNIMARC setups, when you click on
'Choose' to select an authority, it does not populate
subfields $3 (Authority Record Number) and $5 (Tracing
Control), which are required for authority linking and
authority hierarchies to work properly.

In MARC21, all authority data is correctly copied over.

This is due to hardcoded subfield values which are
MARC21-specific in blinddetail-biblio-search{.pl,.tt}.

This patch fixes that by checking the value of the
'marcflavour' syspref, and then setting the correct
subfields to copy the authority data to.

Test plan (involves testing in both a MARC21 and a UNIMARC instance):

0) [PREREQUISITES in order for the authority finder plugin to come up
    when testing in a UNIMARC instance]
   a) You must have at least one authority type besides the 'Default'.
   b) View the MARC structure of the 'Default' auth type, then click
      on 'Actions->Subfields' for tag 500; click on 'Edit subfields'.
      Select the subfield 'a' tab, then pick an auth type from the
      'Thesaurus:' dropdown menu; click 'Save changes' at the top.

1) In the Staff client, go to Authorities, then click 'New Authority'
   and pick the 'Default' authority type.

2) When the authority editor comes up, go to tag 500 and expand it.

3) Click on the Tag editor icon next to subfield $a.

4) When the authority finder comes up, search for an authority, pick
   a relator code from the 'Special relationship:' dropdown, and then
   click on the 'Choose' button for one of the authorities you found.

5) In MARC21: all subfields are populated correctly.
   In UNIMARC: notice how subfields $3 and $5 are *not* populated.

6) Apply the patch.

7) Repeat steps 3) and 4) above.
   In MARC21: all subfields are populated correctly, as before.
   In UNIMARC: both the relator code and the authority id are copied
               over along with any other subfields that may exist.

8) To ensure that authority linking in the Cataloging module works
   as before, launch the bibliographic record editor, find a MARC
   tag that allows you to search for an authority, and link it.
   In MARC21: all authority data is copied over (authid in $9).
   In UNIMARC: all authority data is copied over (authid in $9).

   NOTE: after linking, you may have to expand the MARC tag you
         chose so that subfield $9 becomes visible.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-04-23 09:24:58 -06:00
..
acqui Bug 41653: Move addPrefs and addPermissions under the Koha namespace 2026-04-17 09:18:00 -06:00
admin Bug 42309: JS error when there are no cash registers 2026-04-23 09:24:57 -06:00
authorities Bug 21453: Copy data to the correct subfields when linking authorities with authorities 2026-04-23 09:24:58 -06:00
basket Bug 41958: Rename BibTeX cart and list download options in the staff interface 2026-03-05 08:34:01 -07:00
batch Bug 35267: Ignore style tags with TT tags 2026-04-17 09:18:11 -06:00
bookings Bug 41653: Move addPrefs and addPermissions under the Koha namespace 2026-04-17 09:18:00 -06:00
catalogue Bug 41653: Move addPrefs and addPermissions under the Koha namespace 2026-04-17 09:18:00 -06:00
cataloguing Bug 17387: (follow-up) move records_restore under editcatalogue permission 2026-04-15 14:10:27 -06:00
circ Bug 35267: Move JS to bottom in printslip 2026-04-17 09:18:06 -06:00
clubs Bug 42012: Fix missing preventDefault() call in clubs.tt 2026-03-20 12:01:07 +00:00
course_reserves Bug 38365: Add CSP nonces to all inline script and style tags 2026-03-16 11:57:42 +01:00
erm Bug 38365: Add CSP nonces to all inline script and style tags 2026-03-16 11:57:42 +01:00
errors Bug 41177: (follow-up) A few minor corrections 2025-11-18 06:56:53 -07:00
ill Bug 41861: Update how cost and price_paid show 2026-04-15 09:14:50 -06:00
installer Bug 39055: Change "op" to "login_op" when logging in to allow original op to flow through 2026-03-19 10:51:27 +00:00
labels Bug 38365: Add CSP nonces to all inline script and style tags 2026-03-16 11:57:42 +01:00
mana Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
members Bug 40255: Allow scrubbed HTML to be used 2026-04-17 09:18:14 -06:00
offline_circ Bug 38365: Add CSP nonces to all inline script and style tags 2026-03-16 11:57:42 +01:00
onboarding Bug 40557: Fix layout of enrollment period fields in onboarding 2025-08-29 11:08:50 -06:00
patron_lists Bug 41653: Move addPrefs and addPermissions under the Koha namespace 2026-04-17 09:18:00 -06:00
patroncards Bug 41653: Move addPrefs and addPermissions under the Koha namespace 2026-04-17 09:18:00 -06:00
plugins Bug 42163: (follow-up) fix plugin wrapper menus, plugins-home.tt, and plugins-upload.tt 2026-04-23 09:24:56 -06:00
pos Bug 41653: Move addPrefs and addPermissions under the Koha namespace 2026-04-17 09:18:00 -06:00
preservation Bug 38365: Add CSP nonces to all inline script and style tags 2026-03-16 11:57:42 +01:00
recalls Bug 38365: Add CSP nonces to all inline script and style tags 2026-03-16 11:57:42 +01:00
reports Bug 41760: Fix <tbody> and <tfoot> in several templates 2026-04-10 09:47:58 -06:00
reserve Bug 42288: Tidy all script tags - reserve (auto tidy) 2026-04-17 09:18:01 -06:00
reviews Bug 38365: Add CSP nonces to all inline script and style tags 2026-03-16 11:57:42 +01:00
rotating_collections Bug 39567: Remove form-submit includes from tt files 2025-05-15 08:34:01 +02:00
serials Bug 42277: Remove JS error when viewing a subscription 2026-04-23 09:24:57 -06:00
services Bug 40818: Replace raw with html filter for marc_lib 2025-11-03 09:44:41 -07:00
sip2 Bug 38365: Add CSP nonces to all inline script and style tags 2026-03-16 11:57:42 +01:00
suggestion Bug 41653: Move addPrefs and addPermissions under the Koha namespace 2026-04-17 09:18:00 -06:00
tags Bug 38365: Add CSP nonces to all inline script and style tags 2026-03-16 11:57:42 +01:00
tools Bug 16994: (QA follow-up) Align overwrite result key across module, template and tests 2026-04-17 09:18:17 -06:00
virtualshelves Bug 41653: Move addPrefs and addPermissions under the Koha namespace 2026-04-17 09:18:00 -06:00
about.tt Bug 40816: Adjust about page 2026-04-23 09:24:51 -06:00
auth.tt Bug 39055: Change "op" to "login_op" when logging in to allow original op to flow through 2026-03-19 10:51:27 +00:00
intranet-main.tt Bug 38365: Add CSP nonces to all inline script and style tags 2026-03-16 11:57:42 +01:00