From c6263d078e9374b1712d7b2a452a1ccb614deaef Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Tue, 1 Dec 2020 16:22:15 +0100 Subject: [PATCH] Bug 27128: (bug 25728 follow-up) Don't prefill av's code Bug 25728 patch "Don't prefill av's code" does not work. Calling empty val() retruns the attribut. Should be val(''). Test plan : 1) Without patch 2) Edit a record 3) Edit a subfield with AV 4) Enter a new value to create it 5) You see the modal popup, edit and save 6) Enter another new value to create it 7) You see the modal popup => value is prefilled 8) Re-do test plan with patch (+ clear JS cache) => value is empty Signed-off-by: Jonathan Druart Signed-off-by: Jonathan Druart --- koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js index 6cfccd2539..a66edff559 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js @@ -127,7 +127,7 @@ var Select2Utils = { var category = $(this).data("category"); $("#avCreate #new_av_category").html(category); $("#avCreate input[name='category']").val(category); - $("#avCreate input[name='value']").val(); + $("#avCreate input[name='value']").val(''); $("#avCreate input[name='description']").val(e.params.data.text); $(this).val($(this).find("option:first").val()).trigger('change'); -- 2.39.5