When an itemtype description contains a space character like " Book" (often used to set this itemtype as first in sorted lists), the edition of an existing circulation rule does not work, it selects the default itemtype. Same for patron category. It's because the JavaScript code performs a trim on value existing in table itm = itm.replace(/^\s*|\s*$/g,''); The same trim must be performed on combobox in editing line.
Created attachment 28979 [details] [review] Bug 12451 - circulation rule cant be edited if itemtype contains a space character When an itemtype description contains a space character like " Book" (often used to set this itemtype as first in sorted lists), the edition of an existing circulation rule does not work, it selects the default itemtype. Same for patron category. It's because the JavaScript code performs a trim on value existing in table itm = itm.replace(/^\s*|\s*$/g,''); This patch adds trim on select options in editing line. Test plan : - 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 Check others selects are ok : - 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 Same tests with a patron category containing a leading or trailling space in description
Created attachment 29052 [details] [review] [SIGNED-OFF] Bug 12451 - circulation rule cant be edited if itemtype contains a space character When an itemtype description contains a space character like " Book" (often used to set this itemtype as first in sorted lists), the edition of an existing circulation rule does not work, it selects the default itemtype. Same for patron category. It's because the JavaScript code performs a trim on value existing in table itm = itm.replace(/^\s*|\s*$/g,''); This patch adds trim on select options in editing line. Test plan : - 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 Check others selects are ok : - 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 Same tests with a patron category containing a leading or trailling space in description Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 29054 [details] [review] Bug 12451 - circulation rule cant be edited if itemtype contains a space character When an itemtype description contains a space character like " Book" (often used to set this itemtype as first in sorted lists), the edition of an existing circulation rule does not work, it selects the default itemtype. Same for patron category. It's because the JavaScript code performs a trim on value existing in table itm = itm.replace(/^\s*|\s*$/g,''); This patch adds trim on select options in editing line. Test plan : - 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 Check others selects are ok : - 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 Same tests with a patron category containing a leading or trailling space in description Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Patch pushed to master. Thanks Fridolin!
Pushed to 3.16.x for inclusion in 3.16.2.
Pushed to 3.14.x, will be in 3.14.12.