From c3d063b81b004e42f327c2de93bf43a0b73e7464 Mon Sep 17 00:00:00 2001 From: Petro Vashchuk Date: Wed, 12 Feb 2025 14:36:47 +0000 Subject: [PATCH] Bug 32949: Fix wrong input id The input id was wrong, so instead "else" was handling the flatpickr data as plain text, which prefilled junk data and therefore resetting value of "Hard due date" field to "None defined". To reproduce: 1. Head over to the smart rules admin page and create/use existing rule for certain item type/category. 2. Set "hard due date" that rule to a certain date and save. 3. Edit that same rule again, but this time save it without any changes. Do not click or interact with flatpickr field. Date for hard due date will get lost and will be set as "None defined". 4. Apply the patch. 5. Repeat steps 2 and 3. Ensure that the data loss is not happening anymore. Signed-off-by: Magnus Enger Followed test plan, works as advertised. Signed-off-by: Nick Clemens --- koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt index 9f58ef41c63..7c36fb4d1d0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -1520,7 +1520,7 @@ // specific processing for the Note column var note = $(this).find("a[id='viewnote']").data("content"); $(current_column).find("input[type='text']").val(note); - } else if (current_input_id === "hardduedatecompare") { + } else if (current_input_id === "hardduedate") { // specific processing for Hard due date $(current_column).find("select").val(itm_code); var hardduedate = $(this).data("duedate"); -- 2.39.5