If a field (here it's the branch name) contains a quote, the Select button doesn't work in guarantor_search.pl. For example, if our branch is "Bibliothèque d'Avignon", the resulting json in the link is all broken and the "select" does nothing. Setup: - Have a Child patron and Adult patron in your DB. - In Admin/Libraries and Group, modify the name to add a ' in the middle. Test: - Modify your child patron. - The second section should be "Guarantor Information" - Click the "Set to patron" button - Enter the info to find your adult - In the resulting list, click the Select at the end of the line - Nothing will happen - Hover over the link, you'll see the gibberish inside. - Remove the ' from the branch name. Do the steps above. Everything is alright.
Confirmed. I tested by having a guarantor with a single quote in his/her branch name. The same happens if the single quote appears in the guarantor's name (d'Artangnan) or in the address / city (Bourbon-l'Archambault)
Created attachment 42416 [details] [review] CAM 2145 - Bug 14744 - Fix select guarantor when quote in one of the fields The quote was wrapping the onclick attribute of the select, so i have replaced all of the quotes in borrower data (only for this section) by ' (single quote for html)
Created attachment 42417 [details] [review] CAM 2145 - Bug 14744 - Fix window closing when selecting a guarantor After slecting a guarantor, the window was not closing. Some parts of the form in the user_select function are not defined yet, so the JavaScript was crashing when it encounters the undefined form fields preventing it from closing the window. I only had if conditions to prevent the script form bugging and to close the window.
Created attachment 42419 [details] Quotes from guarantor fields show up encoded in patrons address fields If I select a gaurantor displayed encoded with quotes in the address fields, the patron's address fields are populated with encoded values. --- BTW: Is it a feature or a bug that the patron main address is changed to the guarantor's main address? (That happens already before applying the patches).
Not sure if I'm right but I think there has been at least 2 similar bug reports to this but I couldn't find them now... Anyways, there has been already discussion about some general fix for this (and If I remember right there is already some work done). The fix where the work has been done was not that far away from coming to master (maybe couple of months) but there was also another idea to wait ~2 years until template toolkit's newer version comes to different GNU/Linux distros (and it fixes the problem).
It was Bug 14505 where there was discussion about this kind of bugs.
...and Bug 14691 - Can't delete patron with ' character in cardnumber
I'd love to see these bugs fixed, I think we should put our attention into bug 13618 rather than fixing all of these independent occurrences of the same-ish problem. 13618 will need heaps of testing.
I believe this is fixed by Bug 16450. *** This bug has been marked as a duplicate of bug 16450 ***