From bf8afc1c361ccac3c643d9b723e5d29341c61f61 Mon Sep 17 00:00:00 2001 From: Emmi Takkinen Date: Thu, 4 Jul 2024 15:04:42 +0300 Subject: [PATCH] Bug 37254: Fix clearing of dropdown values on circulation rules When one tries to clear the rule they are editing in circulation rules page via "Clear" button, dropdown selectors aren't populated with default value (first on the list). To reproduce: 1. Select a rule to edit. 2. Press "Clear" button to return edit rows values back to default values. => Values in dropdowns aren't set back as default, instead they have same values as rule you edited before pressing "Clear". 3. Apply this patch. 4. Select rule to edit, then press "Clear". => Dropdowns now have default values. Sponsored-by: Koha-Suomi Oy Signed-off-by: Chris Cormack Signed-off-by: Laura_Escamilla Signed-off-by: Katrin Fischer (cherry picked from commit f1f08f92c52dc92eed71110f1c4d7711148c8b5c) Signed-off-by: Lucas Gass (cherry picked from commit d0cb0ff57b306c7a9b67c38a41cb37230b0ea175) Signed-off-by: Fridolin Somers --- koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt | 1 + 1 file changed, 1 insertion(+) 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 d333efb842..8cc037486a 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 @@ -1443,6 +1443,7 @@ } }); $(edit_row).find("select").prop('disabled', false); + $(edit_row).find("select option:selected").removeAttr('selected'); $(edit_row).find("select option:first-child").attr("selected", "selected"); $(edit_row).find("td:last input[name='clear']").remove(); } -- 2.39.5