If a patron has a backslash character ( \ ) in a field displayed in the patron search, and that patron is part of a set of search results, those search results will never display. Instead, it will just sit at the "Processing..." message forever.
Created attachment 38340 [details] [review] Bug 14044 - Backslashes ( and possibly other characters ) break patron search If a patron has a backslash character ( \ ) in a field displayed in the patron search, and that patron is part of a set of search results, those search results will never display. Instead, it will just sit at the "Processing..." message forever. Test Plan: 1) Edit a patron, add a backslash to the address for the patron 2) Do a patron search where this patron would be one of many results 3) Note the results never display 4) Apply this patch 5) Repeat step 2 6) Note the results now display
Created attachment 38343 [details] [review] Bug 14044 - Backslashes ( and possibly other characters ) break patron search If a patron has a backslash character ( \ ) in a field displayed in the patron search, and that patron is part of a set of search results, those search results will never display. Instead, it will just sit at the "Processing..." message forever. Test Plan: 1) Edit a patron, add a backslash to the address for the patron 2) Do a patron search where this patron would be one of many results 3) Note the results never display 4) Apply this patch 5) Repeat step 2 6) Note the results now display Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
The bad news is that the issue is certainly also present on members/tables/guarantor_search.tt patroncards/tables/members_results.tt, serials/tables/members_results.tt and common/patron_search.tt But some of the patron information is not displayed on them.
With the patch applied, there are "" appearing in the result table, even for empty fields.
Created attachment 38542 [details] [review] Bug 14044: Escape json strings for patron searches In a couple of patron searches, the address is displayed. If the address contain invalid json characters, DataTables won't manage to parse the results and display them. This patch makes the templates more readable by creating a BLOCK instead of a long line and escape the invalid json characters calling the TT plugin (To.json). Test plan: Edit a patron and add something like: patron <address> \123 ☎ ⚑ in the address field. Search for this patron using the main patron search (members/member.pl) and the guarantor search. Confirm that a result with this patron is correctly displayed. Regression test: Since Koha::Template::Plugin::To::json is modified, confirm that the add users to basket search (on acqui/basket.pl?basketno=X click on the "Add user" button) still works as expected.
Works in circulation.pl. Problem still exists in member.pl and guarantor_search.pl. Don't know about other areas. Christopher
(In reply to Christopher Brannon from comment #6) > Works in circulation.pl. Problem still exists in member.pl and > guarantor_search.pl. Don't know about other areas. > > Christopher Hi Christopher, What does not work? I have tried again it seems to work. Note that this patch does not modify the circulation.pl
(In reply to Jonathan Druart from comment #7) > Hi Christopher, > What does not work? I have tried again it seems to work. > Note that this patch does not modify the circulation.pl Turns out the patch is not applying. Please take a look at the patch when you can. Christopher
Created attachment 38641 [details] [review] Bug 14044: Escape json strings for patron searches In a couple of patron searches, the address is displayed. If the address contain invalid json characters, DataTables won't manage to parse the results and display them. This patch makes the templates more readable by creating a BLOCK instead of a long line and escape the invalid json characters calling the TT plugin (To.json). Test plan: Edit a patron and add something like: patron <address> \123 ☎ ⚑ in the address field. Search for this patron using the main patron search (members/member.pl) and the guarantor search. Confirm that a result with this patron is correctly displayed. Regression test: Since Koha::Template::Plugin::To::json is modified, confirm that the add users to basket search (on acqui/basket.pl?basketno=X click on the "Add user" button) still works as expected.
Created attachment 38671 [details] [review] [SIGNED OFF]Bug 14044: Escape json strings for patron searches In a couple of patron searches, the address is displayed. If the address contain invalid json characters, DataTables won't manage to parse the results and display them. This patch makes the templates more readable by creating a BLOCK instead of a long line and escape the invalid json characters calling the TT plugin (To.json). Test plan: Edit a patron and add something like: patron <address> \123 ☎ ⚑ in the address field. Search for this patron using the main patron search (members/member.pl) and the guarantor search. Confirm that a result with this patron is correctly displayed. Regression test: Since Koha::Template::Plugin::To::json is modified, confirm that the add users to basket search (on acqui/basket.pl?basketno=X click on the "Add user" button) still works as expected. Signed-off-by: Christopher Brannon <cbrannon@cdalibary.org>
Did the sign off, but had to figure out how to work around issues the special characters in your test plan created. FYI. Otherwise, looks good. Works great. Christopher
Sorry, I found another something - try adding a " to the address data - it will display as " on the patron result list.
Created attachment 38718 [details] [review] Bug 14044: Don't escape html characters
(In reply to Katrin Fischer from comment #12) > Sorry, I found another something - try adding a " to the address data - it > will display as " on the patron result list. Yes, either we escape html characters or not :) It seems that there are not in other places, but in this case if a <td> or <tr> is found, it will make the table explodes. But... who does put these tags or quote in an address field? :)
It literally showed up as " in the result list - but retesting it now it is ok.
Created attachment 38790 [details] [review] [PASSED QA] Bug 14044: Escape json strings for patron searches In a couple of patron searches, the address is displayed. If the address contain invalid json characters, DataTables won't manage to parse the results and display them. This patch makes the templates more readable by creating a BLOCK instead of a long line and escape the invalid json characters calling the TT plugin (To.json). Test plan: Edit a patron and add something like: patron <address> \123 ☎ ⚑ in the address field. Search for this patron using the main patron search (members/member.pl) and the guarantor search. Confirm that a result with this patron is correctly displayed. Regression test: Since Koha::Template::Plugin::To::json is modified, confirm that the add users to basket search (on acqui/basket.pl?basketno=X click on the "Add user" button) still works as expected. Signed-off-by: Christopher Brannon <cbrannon@cdalibary.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 38791 [details] [review] [PASSED QA] Bug 14044: Don't escape html characters Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Patches pushed to master. Thanks Jonathan!
Feeling like this might be a candidate for 3.18, so making note to myself to check it. -Liz
This is a problem all the way back into 3.18, and the patches won't come over cleanly. Might we have a 3.18 version of this? Cheers, Liz
Actually I was wrong, it wasn't the slash, it was \r\n in the address fields that are doing it - so yeah, backslashes explode this in 3.18.
Mason did you mean to change the status on this bug?
(In reply to Liz Rea from comment #22) > Mason did you mean to change the status on this bug? hi, yes... is the new status not correct?
:) nope, it needs a patch for 3.18, but there isn't one yet. :)
(In reply to Mason James from comment #23) > (In reply to Liz Rea from comment #22) > > Mason did you mean to change the status on this bug? > > hi, yes... is the new status not correct? Chris didn't pick it for 3.20 yet. So it should remain 'Pushed to master' so he notices it. Well, or Liz could just tell him :-D
Hehe I don't tell Chris what to do. ^.^
(In reply to Tomás Cohen Arazi from comment #25) > (In reply to Mason James from comment #23) > > (In reply to Liz Rea from comment #22) > > > Mason did you mean to change the status on this bug? > > > > hi, yes... is the new status not correct? > > Chris didn't pick it for 3.20 yet. both patches for this bug seem to be in the stable branch? http://git.koha-community.org/gitweb/?p=koha.git;a=shortlog;h=refs/heads/3.20.x;pg=3 2015-05-06 Jonathan Druart Bug 14044: Don't escape html characters 2015-05-06 Jonathan Druart Bug 14044: Escape json strings for patron searches
This is in 3.20.1, looks like it was missed for a bug update though. Sorry Mason. :)
Depends on 13021 for TT plugin To