Bug 32823: Fix cataloguing/value_builder/unimarc_field_100_authorities.pl
authorJulian Maurice <julian.maurice@biblibre.com>
Fri, 3 Feb 2023 10:58:51 +0000 (11:58 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 24 Feb 2023 20:00:48 +0000 (17:00 -0300)
Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
cataloguing/value_builder/unimarc_field_100_authorities.pl

index f15185c..a1a6b87 100755 (executable)
@@ -30,7 +30,9 @@ sub plugin_javascript {
     my ( $dbh, $record, $tagslib, $field_number ) = @_;
     my $res           = "
         <script>
-            function Clic$field_number(i) {
+            function Clic$field_number(event) {
+                event.preventDefault();
+                const i = event.data.id;
                 var defaultvalue;
                 try {
                     defaultvalue = document.getElementById(i).value;