From a7646d86d35165adad970dec5f669ec0d6ae3e3f Mon Sep 17 00:00:00 2001 From: Eric Phetteplace Date: Wed, 6 May 2026 15:57:30 -0700 Subject: [PATCH] Bug 42116: e.preventDefault is a function, needs parentheses This change is unnoticeable in the UI, so the patch does not need before/after testing, but assurance that everything works. The affected code is used in 3 places for holds (cancelling a hold from reserve/request.pl, circ/circulation.pl, and members/moremember.pl) and 2 for cataloging (two different functions on cataloguing/additem.pl). For holds: 1. Create three holds on different bibs for a patron 2. On the same page where you create the last hold (reserve/request.pl), delete it 3. Circulation > Check out (circ/circulation.pl) > Check out a different title to patron 4. Switch to patron's Holds tab, delete a hold 5. Go to Patrons account (members/moremember.pl) > Holds tab, delete a hold 6. All holds should delete successfully For cataloging: 1. Go to any bib > New > New item 2. Select "Add Multiple Copies of this Item", add a note 3. Confirm multiple items are created with the note 4. Enter a new note, then select "Save as template" 5. Confirm the item template exists & create an item using it Signed-off-by: David Nind Signed-off-by: Jonathan Druart Signed-off-by: Pedro Amorim --- koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js | 4 ++-- koha-tmpl/intranet-tmpl/prog/js/holds.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js index 1de2bda6e1..64f8f89ea0 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging_additem.js @@ -76,7 +76,7 @@ $(document).ready(function () { multiCopyControl.hide(); $("#add_multiple_copies").on("click", function (e) { - e.preventDefault; + e.preventDefault(); addMultipleBlock.toggle(); saveTemplateBlock.toggle(); addSingleBlock.toggle(); @@ -93,7 +93,7 @@ $(document).ready(function () { saveAsTemplateControl.hide(); $("#save_as_template").on("click", function (e) { - e.preventDefault; + e.preventDefault(); saveTemplateBlock.toggle(); saveAsTemplateControl.toggle(); $("#template_name").focus(); diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js index c590ddc5f2..f06cdebd8c 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/holds.js +++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js @@ -754,7 +754,7 @@ $(document).ready(function () { // Confirm cancellation of hold let cancel_link; $(document).on("click", ".cancel-hold", function (e) { - e.preventDefault; + e.preventDefault(); cancel_link = $(this); $("#cancel_modal_form #inputs").empty(); let reserve_id = cancel_link.data("id"); @@ -2030,7 +2030,7 @@ async function load_patron_holds_table(biblio_id, split_data) { $(this).parent().parent().toggleClass("selected"); }); $(".cancel-hold." + table_class).on("click", function (e) { - e.preventDefault; + e.preventDefault(); cancel_link = $(this); $("#cancel_modal_form #inputs").empty(); let reserve_id = cancel_link.data("id");