From b2dd862d97d4375d5c3a8e83bb81462561453db2 Mon Sep 17 00:00:00 2001 From: Petro Vashchuk Date: Mon, 10 Feb 2025 14:52:57 +0200 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. --- 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 3f85d4b819..576bf5f90a 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 @@ -1555,7 +1555,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.34.1