From 0b5484956d350c6282bce7041195e5809446ee9a Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 9 Sep 2021 15:21:10 +0000 Subject: [PATCH] Bug 28986: Remove (All) notation to correctly select rule for editing This patch updates the JS comparison code to remove the '(All)' hint before comparing to the current value To test: 1 - Go to Administration -> Item types 2 - Edit a type to have a parent of another type 3 - Go to Administration -> Circulation and fines rules 4 - Add a rule for all categories for the child itemtype 5 - Add a rule for all categories for the parent itemtype 6 - Click edit on child type, note itemtype dropdown in editor correctly selected 7 - Click edit on parent type - note itemtype dropdown menu refers to 'All' itemtypes 8 - Apply patch 9 - Reload page and edit parent type rule 10 - Itemtype dropdown is correctly populated --- 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 95a8e53ac1..172e546f8a 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 @@ -1133,6 +1133,7 @@ // select the corresponding option $(current_column).find("select option").each(function(){ opt = $(this).text().toLowerCase(); + opt = opt.replace(/ \(all\)$/,""); //If option is a parent, compare without (All) itm = itm.replace(/.*->(.*)/,"$1"); //If item type is part of a group we need to clear the parent description opt = opt.replace(/^\s*|\s*$/g,''); if ( opt == itm.toLowerCase() ) { -- 2.20.1