Bug 32675

Summary: Cannot add a guarantor when there is a single quote in the guarantor attributes
Product: Koha Reporter: Hammat wele <hammat.wele>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: arthur.suzuki, caroline.cyr-la-rose, cbrannon, gmcharlt, jonathan.druart, kyle.m.hall, lucas, philippe.blouin
Version: Main   
Hardware: All   
OS: All   
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
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.
Bug 32675: Cannot add a guarantor when there is a single quote in the guarantor attributes
Bug 32675: Cannot add a guarantor when there is a single quote in the guarantor attributes
Bug 32675: Cannot add a guarantor when there is a single quote in the guarantor attributes
Bug 32675: [alternative patch] Fix guarantor selection when simple quote present
Bug 32675: [alternative patch] Fix guarantor selection when simple quote present
Bug 32675: [alternative patch] Fix guarantor selection when simple quote present

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 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 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 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 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 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. ***