From 9b1a14994d0b3a553b36de135be9768dc286c038 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 29 May 2025 12:34:31 +0000 Subject: [PATCH] Bug 40025: Fix change type for edit item metadata 1) Enable ILLModule 2) Create a new ILL request: /cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard 3) Add a type, a cardnumber '42' and any library. Click 'Make request'. 4) You should now be on the 'Manage request' page. Click 'Edit item metadata'. 5) Change the type. Notice the form doesn't update the fields (as it does when you create a new ILL request). 6) Apply patch. Repeat step 5. Notice the form now updates the fields as it does when you create a new ILL request. Signed-off-by: David Nind --- .../includes/ill/backends/Standard/shared/shared.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/shared/shared.js b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/shared/shared.js index 46623bc0f7..0c49b1daa7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/shared/shared.js +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill/backends/Standard/shared/shared.js @@ -24,10 +24,14 @@ document.addEventListener("DOMContentLoaded", function () { $(event.target).parent().remove(); }); $("#type").change(function () { - $("#create_form").prepend( - '' - ); - $("#create_form").submit(); + $("#create_form, #standard_edit_form") + .first() + .submit(function () { + $(this).prepend( + '' + ); + }) + .submit(); }); $("#standard-fields").on("keyup", ".custom-name", function () { var val = $(this).val(); -- 2.39.5