Bug 21349: Instructors with special characters in cardnumber cannot be removed from...
authorMark Tompsett <mtompset@hotmail.com>
Fri, 14 Sep 2018 23:06:49 +0000 (16:06 -0700)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 28 Nov 2018 11:00:35 +0000 (12:00 +0100)
commit4c839227058208b73893f1bd3615ebf05e94581c
tree82cf564390ecf8f15b6c9d305ad824de14bd54a5
parentdc499a612eb5f8ac2b31c6ca39aaad4c1a3918e7
Bug 21349: Instructors with special characters in cardnumber cannot be removed from course reserves

The cardnumber can contain strange non-javascript-friendly
characters. This patch converts all the internal references
to borrowernumber, but displays the cardnumber when showing
list of matching users.

TEST PLAN
---------
1) Make sure Course Reserves is being used. Check system preferences.
2) Make sure there is a Course entered.
3) Make sure there is a patron with an cardnumber which breaks
   the existing javascript (eg. Ka-boom:Ka-boom!KABOOM@#$!)
4) Go into the course list.
5) Click the course name link
6) In the "Instructor Search" box enter the patron name.
7) Select the patron which has the ugly cardnumber.
8) Click Save
   -- The course listing should have the new teacher listed.
9) Click the course name link again.
10) Click 'Remove' beside the instructor's name.
    -- nothing happens, and inspecting the error console gives
       you the ugly error described in comment #0
11) apply this patch
12) restart_all
13) sudo service apache2 restart
14) refresh the page.
15) click 'Remove' beside the instructor's name.
    -- name is removed.
16) Click Save
    -- the course listing no longer lists the new teacher.
17) Actually confirm that adding and removing others normally
    works as expected.
18) run koha qa test tools.

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

(cherry picked from commit 2ca766f39245e1c3bd9b4acc9ce01a9eeaec8a56)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

(cherry picked from commit 827da7b676d8cbe42f696613541d1217d3f9370a)

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
course_reserves/mod_course.pl
koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course.tt