Bug 38987: Use the correct HTML id attribute

Starting with Koha 24.11.01, we can no longer link authorities with
other authorities (linking a bibliographic record with an authority
still works fine). This affects both MARC21 and UNIMARC instances,
and is valid on the main branch, too.

This patch fixes that.

Test plan:

1) Navigate to Koha's Authorities module and create a new authority
   (using the 'Default' authority type). In tab 5, expand field 500
   by clicking on its description.

2) Launch the Authority finder form by clicking on the small 'Tag
   editor' button on the far right of subfield 500$a.

3) Click the yellow 'Search' button at the bottom of the page.
   When the results appear, click on the '+ Choose' button for
   one of the authorities (any authority will do).

   Notice that nothing happens and the Authority finder stays open,
   whereas normally it should close automatically at this point and
   transfer you back to the authority editor, copying the info from
   the authority you selected into the subfields of field 500.

   Press F12 (works in Chrome and Firefox) to launch the Developer
   Tools of your browser and notice that in the JavaScript console
   the following error message has been registered:

   "Uncaught TypeError: e is null"

4) Apply this patch (and restart_all for good measure), then press
   CTRL-F5 to reload all JS assets.

5) Repeat step 3) above; this time, when you click on the '+ Choose'
   button the authority finder window will close and the contents of
   the authority you selected will be copied into the subfields of
   field 500.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 48aad541cc)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
This commit is contained in:
Andreas Roussos 2025-01-28 16:00:14 +00:00 committed by Baptiste Wojtkowski
parent fcca81ad77
commit 02ecbcb408
No known key found for this signature in database
GPG Key ID: 47A8A13E10BC0D40
1 changed files with 2 additions and 2 deletions

View File

@ -142,8 +142,8 @@
function doauth(authid, index, repet){
[% IF source == 'auth' %]
var e = document.getElementById("relationship");
var relationship = e.options[e.selectedIndex].value;
var elem = document.getElementById("special_relationship");
var relationship = elem.options[elem.selectedIndex].value;
jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet + '&relationship=' + relationship);
[% ELSE %]