Bug 9113: fix handling of certain characters by item batch modification tool
authorFridolyn SOMERS <fridolyn.somers@biblibre.com>
Wed, 26 Jun 2013 15:52:40 +0000 (17:52 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 5 Jul 2013 15:35:25 +0000 (15:35 +0000)
commit0397e7ea64c208c140d7178ed34c3bd4b266fcfb
tree6447bf094ddb6bacfdb17c57a4d409ded5c3bb20
parentbed99a851646fd0c7a4c906dd9dfe60c485b40c6
Bug 9113: fix handling of certain characters by item batch modification tool

If you're using the batch modification tool and entering a call number
like "E+ 123 ABC", the tool removes the + and puts a space in its place,
e.g., "E  123 ABC"

This is because the form is posted via Ajax by background-job-progressbar.js.
Values are URI-encoded using escape(), but this method does not escape some
characters: * @ - _ + . /

Also, "+" is considered as a space in a URI.

This patch replaces escape() by encodeURIComponent() which encodes every character.

Test plan :
Perform an items batch modification by setting '* @ - _ + . /' in a field
(notes for example) and see that all characters are saved correctly.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/js/background-job-progressbar.js