Bug 32675 - Cannot add a guarantor when there is a single quote in the guarantor attributes
Summary: Cannot add a guarantor when there is a single quote in the guarantor attributes
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
: 32233 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-01-18 17:24 UTC by Hammat wele
Modified: 2024-01-04 14:42 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.04,22.05.11
Circulation function:


Attachments
Bug 32675: Cannot add a guarantor when there is a single quote in the guarantor attributes It's impossible to select a guarantor when there is a single quote in the guarantor attributes. (2.67 KB, patch)
2023-01-18 17:33 UTC, Hammat wele
Details | Diff | Splinter Review
Bug 32675: Cannot add a guarantor when there is a single quote in the guarantor attributes (2.67 KB, patch)
2023-01-18 17:40 UTC, Hammat wele
Details | Diff | Splinter Review
Bug 32675: Cannot add a guarantor when there is a single quote in the guarantor attributes (2.73 KB, patch)
2023-01-19 17:23 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 32675: Cannot add a guarantor when there is a single quote in the guarantor attributes (2.78 KB, patch)
2023-01-31 14:39 UTC, solene.ngamga
Details | Diff | Splinter Review
Bug 32675: [alternative patch] Fix guarantor selection when simple quote present (2.19 KB, patch)
2023-02-22 15:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32675: [alternative patch] Fix guarantor selection when simple quote present (2.25 KB, patch)
2023-03-03 14:04 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 32675: [alternative patch] Fix guarantor selection when simple quote present (2.30 KB, patch)
2023-03-03 19:16 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Hammat wele 2023-01-18 17:24:24 UTC Comment hidden (obsolete)
Comment 1 Hammat wele 2023-01-18 17:33:22 UTC Comment hidden (obsolete)
Comment 2 Hammat wele 2023-01-18 17:40:57 UTC
Created attachment 145404 [details] [review]
Bug 32675: Cannot add a guarantor when there is a single quote in the guarantor attributes

It's impossible to select a guarantor when there is a single quote in the guarantor attributes.

This patch allows to add a guarantor even if there is a single quote in guarantor attributes.

Test plan
1. Find two patrons:
  - Patron 1 = guarantee
  - Patron 2 = guarantor
2. In the patron 2 account, add a single quote in one of the 'Alternate address' or 'Contact information' fields (like the 'Address' field)
for example type «L'Aqueduc» in the field and save
3. Edit the patron 1 and click on 'Add guarantor'
4. Search for the patron 2
5. Click on 'Select'
  --> Nothing happens
6. Apply the patch
9. repeat step 3, 4 and 5
10. Now Patron 2 is added as guarantor
Comment 3 Lucas Gass (lukeg) 2023-01-19 17:23:13 UTC
Created attachment 145490 [details] [review]
Bug 32675: Cannot add a guarantor when there is a single quote in the guarantor attributes

It's impossible to select a guarantor when there is a single quote in the guarantor attributes.

This patch allows to add a guarantor even if there is a single quote in guarantor attributes.

Test plan
1. Find two patrons:
  - Patron 1 = guarantee
  - Patron 2 = guarantor
2. In the patron 2 account, add a single quote in one of the 'Alternate address' or 'Contact information' fields (like the 'Address' field)
for example type «L'Aqueduc» in the field and save
3. Edit the patron 1 and click on 'Add guarantor'
4. Search for the patron 2
5. Click on 'Select'
  --> Nothing happens
6. Apply the patch
9. repeat step 3, 4 and 5
10. Now Patron 2 is added as guarantor

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 4 solene.ngamga 2023-01-31 14:39:30 UTC
Created attachment 145880 [details] [review]
Bug 32675: Cannot add a guarantor when there is a single quote in the guarantor attributes

It's impossible to select a guarantor when there is a single quote in the guarantor attributes.

This patch allows to add a guarantor even if there is a single quote in guarantor attributes.

Test plan
1. Find two patrons:
  - Patron 1 = guarantee
  - Patron 2 = guarantor
2. In the patron 2 account, add a single quote in one of the 'Alternate address' or 'Contact information' fields (like the 'Address' field)
for example type «L'Aqueduc» in the field and save
3. Edit the patron 1 and click on 'Add guarantor'
4. Search for the patron 2
5. Click on 'Select'
  --> Nothing happens
6. Apply the patch
9. repeat step 3, 4 and 5
10. Now Patron 2 is added as guarantor

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Solene Ngamga <solene.ngamga@inLibro.com>
Comment 5 Jonathan Druart 2023-02-22 15:33:36 UTC
Created attachment 147169 [details] [review]
Bug 32675: [alternative patch] Fix guarantor selection when simple quote present
Comment 6 Jonathan Druart 2023-02-22 15:34:21 UTC
I think this patch is less hazardous, we let the escape to JS internal.
Comment 7 Lucas Gass (lukeg) 2023-03-03 14:04:07 UTC
Created attachment 147699 [details] [review]
Bug 32675: [alternative patch] Fix guarantor selection when simple quote present

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 8 Nick Clemens (kidclamp) 2023-03-03 19:16:30 UTC
Created attachment 147727 [details] [review]
Bug 32675: [alternative patch] Fix guarantor selection when simple quote present

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 9 Tomás Cohen Arazi (tcohen) 2023-03-10 13:24:00 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 10 Matt Blenkinsop 2023-03-10 16:26:33 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 11 Christopher Brannon 2023-03-14 19:37:06 UTC
Lucas, can this be back ported to 22.5?  I can't expect our staff to do the gymnastics required to get around this until 22.11.
Comment 12 Lucas Gass (lukeg) 2023-03-14 20:07:31 UTC
Backported to 22.05.x for upcoming 22.05.11
Comment 13 Christopher Brannon 2023-03-14 20:31:27 UTC
(In reply to Lucas Gass from comment #12)
> Backported to 22.05.x for upcoming 22.05.11

That is good news.  Thanks for doing this!
Comment 14 Arthur Suzuki 2023-03-30 07:38:18 UTC
This one doesn't apply cleanly on 21.11, conflicts is not trivial to fix.
Won't backport unless patch provided
Comment 15 Jonathan Druart 2024-01-04 14:42:45 UTC
*** Bug 32233 has been marked as a duplicate of this bug. ***