@@ -, +, @@ contains a space character - Create an itemtype with a leading or trailling space in description : ie " Book" - Go to cgi-bin/koha/admin/smart-rules.pl - Create a rule with this itemtype, Unit=hours and Hard due date=Exactly on 31/12/2015 (any date) - Click on Edit on this rule line => Without this patch, the default itemtype is selected in edition line => With this patch, the correct itemtype is selected in edition line - Create a rule with Unit=hours and Hard due date=Exactly on 31/12/2015 (any date) - Click on Edit on this rule line => The correct options are selected --- koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -42,7 +42,9 @@ $(document).ready(function() { $(current_column).find("input[type='text']").val(itm); // select the corresponding option $(current_column).find("select option").each(function(){ - if ( $(this).text().toLowerCase() == itm.toLowerCase() ) { + opt = $(this).text().toLowerCase(); + opt = opt.replace(/^\s*|\s*$/g,''); + if ( opt == itm.toLowerCase() ) { $(this).attr('selected', 'selected'); } }); --