From b88edffee414149e0a4e47c10d7f0dd6b6275986 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 --- 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 c4943b3407..b21b3351c9 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 @@ -1464,6 +1464,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.2